summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2015-10-23 22:30:57 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2015-10-23 22:30:57 (GMT)
commit24c49324b4488e47b21eaa259a0950464f9b930c (patch)
tree6fcf1d911bc9e4fe97ac30aa69760179118fdb25
parent2117a3bcf0ee00ee1c7036744732be970cfd6181 (diff)
downloadtcl-24c49324b4488e47b21eaa259a0950464f9b930c.zip
tcl-24c49324b4488e47b21eaa259a0950464f9b930c.tar.gz
tcl-24c49324b4488e47b21eaa259a0950464f9b930c.tar.bz2
Ensure that at lease the format of the output of the platform package's commands is consistently parsable.
-rw-r--r--tests/platform.test13
1 files changed, 12 insertions, 1 deletions
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