From 24c49324b4488e47b21eaa259a0950464f9b930c Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 23 Oct 2015 22:30:57 +0000 Subject: Ensure that at lease the format of the output of the platform package's commands is consistently parsable. --- tests/platform.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/platform.test b/tests/platform.test index ab82d07..b5ddc48 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -1,4 +1,4 @@ -# The file tests the tcl_platform variable +# The file tests the tcl_platform variable and platform package. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and @@ -54,6 +54,17 @@ test platform-3.1 {CPU ID on Windows/UNIX} \ -match regexp \ -result {^(?:AuthenticAMD|CentaurHauls|CyrixInstead|GenuineIntel)$} +# The platform package makes very few promises, but does promise that the +# format of string it produces consists of two non-empty words separated by a +# hyphen. +package require platform +test platform-4.1 {format of platform::identify result} -match regexp -body { + platform::identify +} -result {^[^-]+-[^-]+$} +test platform-4.2 {format of platform::generic result} -match regexp -body { + platform::generic +} -result {^[^-]+-[^-]+$} + # cleanup cleanupTests -- cgit v0.12