aboutsummaryrefslogtreecommitdiff
path: root/tests/variable
diff options
context:
space:
mode:
Diffstat (limited to 'tests/variable')
-rw-r--r--tests/variable/representation/build/bootstrap.build4
-rw-r--r--tests/variable/representation/buildfile18
-rw-r--r--tests/variable/representation/driver.cxx10
-rw-r--r--tests/variable/representation/test.out6
4 files changed, 38 insertions, 0 deletions
diff --git a/tests/variable/representation/build/bootstrap.build b/tests/variable/representation/build/bootstrap.build
new file mode 100644
index 0000000..6a48e2e
--- /dev/null
+++ b/tests/variable/representation/build/bootstrap.build
@@ -0,0 +1,4 @@
+project = variable-representation
+amalgamation = # Disabled.
+using config
+using test
diff --git a/tests/variable/representation/buildfile b/tests/variable/representation/buildfile
new file mode 100644
index 0000000..22913d5
--- /dev/null
+++ b/tests/variable/representation/buildfile
@@ -0,0 +1,18 @@
+# Test reversibility of variable representation.
+#
+val = -L/
+val += -L/foo/
+#val += dir{-L/}
+
+val += foo%bar
+val += foo%
+val += %bar
+val += foo%{bar}
+#val += foo%file{x}
+
+using cxx
+cxx.ext = cxx
+
+exe{driver}: cxx{driver}
+exe{driver}: test.output = test.out
+exe{driver}: test.options = $val
diff --git a/tests/variable/representation/driver.cxx b/tests/variable/representation/driver.cxx
new file mode 100644
index 0000000..ecff9e2
--- /dev/null
+++ b/tests/variable/representation/driver.cxx
@@ -0,0 +1,10 @@
+#include <iostream>
+
+using namespace std;
+
+int
+main (int argc, const char* argv[])
+{
+ for (int i (1); i < argc; ++i)
+ cout << "'" << argv[i] << "'" << endl;
+}
diff --git a/tests/variable/representation/test.out b/tests/variable/representation/test.out
new file mode 100644
index 0000000..af12c6f
--- /dev/null
+++ b/tests/variable/representation/test.out
@@ -0,0 +1,6 @@
+'-L/'
+'-L/foo/'
+'foo%bar'
+'foo%'
+'%bar'
+'foo%bar'