summaryrefslogtreecommitdiff
path: root/xmlif/test
diff options
context:
space:
mode:
Diffstat (limited to 'xmlif/test')
-rw-r--r--xmlif/test/result-bar29
-rw-r--r--xmlif/test/result-baz29
-rw-r--r--xmlif/test/result-foo29
-rw-r--r--xmlif/test/result-html29
-rw-r--r--xmlif/test/result-no-condition29
-rw-r--r--xmlif/test/result-pdf29
-rw-r--r--xmlif/test/result-ps29
-rw-r--r--xmlif/test/result-unrelated-condition29
-rwxr-xr-xxmlif/test/run-test19
-rw-r--r--xmlif/test/test.xml29
10 files changed, 280 insertions, 0 deletions
diff --git a/xmlif/test/result-bar b/xmlif/test/result-bar
new file mode 100644
index 0000000..52b3c39
--- /dev/null
+++ b/xmlif/test/result-bar
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+
+
+
+
+
+
+Otherwise issue this text.
+
+Always issue this text.
+<!-- this ends the test on the manual page -->
+
+
+
+
+
+Should display only if condition is not foo and not baz
+
+
+
+
+
+
+
+Should display only if condition is bar
+
+Postamble.
diff --git a/xmlif/test/result-baz b/xmlif/test/result-baz
new file mode 100644
index 0000000..2ff6f77
--- /dev/null
+++ b/xmlif/test/result-baz
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+
+
+
+
+
+
+Otherwise issue this text.
+
+Always issue this text.
+<!-- this ends the test on the manual page -->
+
+
+
+Should display only if condition is baz
+
+
+
+
+Should display only if condition is not bar
+
+
+
+
+
+
+Postamble.
diff --git a/xmlif/test/result-foo b/xmlif/test/result-foo
new file mode 100644
index 0000000..3acc890
--- /dev/null
+++ b/xmlif/test/result-foo
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+
+
+
+
+
+
+Otherwise issue this text.
+
+Always issue this text.
+<!-- this ends the test on the manual page -->
+
+Should display only if condition is foo
+
+
+
+
+
+
+Should display only if condition is not bar
+
+
+
+
+
+
+Postamble.
diff --git a/xmlif/test/result-html b/xmlif/test/result-html
new file mode 100644
index 0000000..f567b81
--- /dev/null
+++ b/xmlif/test/result-html
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+
+Issue this text if 'condition=html' is given on the command line.
+
+
+
+
+
+
+Always issue this text.
+<!-- this ends the test on the manual page -->
+
+
+
+
+
+Should display only if condition is not foo and not baz
+
+
+Should display only if condition is not bar
+
+
+
+
+
+
+Postamble.
diff --git a/xmlif/test/result-no-condition b/xmlif/test/result-no-condition
new file mode 100644
index 0000000..fe592d8
--- /dev/null
+++ b/xmlif/test/result-no-condition
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+
+
+
+
+
+
+Otherwise issue this text.
+
+Always issue this text.
+<!-- this ends the test on the manual page -->
+
+
+
+
+
+Should display only if condition is not foo and not baz
+
+
+Should display only if condition is not bar
+
+
+
+
+
+
+Postamble.
diff --git a/xmlif/test/result-pdf b/xmlif/test/result-pdf
new file mode 100644
index 0000000..4086031
--- /dev/null
+++ b/xmlif/test/result-pdf
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+
+
+
+Issue this text if 'condition=pdf' or 'condition=ps'
+is given on the command line.
+
+
+
+Always issue this text.
+<!-- this ends the test on the manual page -->
+
+
+
+
+
+Should display only if condition is not foo and not baz
+
+
+Should display only if condition is not bar
+
+
+
+
+
+
+Postamble.
diff --git a/xmlif/test/result-ps b/xmlif/test/result-ps
new file mode 100644
index 0000000..4086031
--- /dev/null
+++ b/xmlif/test/result-ps
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+
+
+
+Issue this text if 'condition=pdf' or 'condition=ps'
+is given on the command line.
+
+
+
+Always issue this text.
+<!-- this ends the test on the manual page -->
+
+
+
+
+
+Should display only if condition is not foo and not baz
+
+
+Should display only if condition is not bar
+
+
+
+
+
+
+Postamble.
diff --git a/xmlif/test/result-unrelated-condition b/xmlif/test/result-unrelated-condition
new file mode 100644
index 0000000..fe592d8
--- /dev/null
+++ b/xmlif/test/result-unrelated-condition
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+
+
+
+
+
+
+Otherwise issue this text.
+
+Always issue this text.
+<!-- this ends the test on the manual page -->
+
+
+
+
+
+Should display only if condition is not foo and not baz
+
+
+Should display only if condition is not bar
+
+
+
+
+
+
+Postamble.
diff --git a/xmlif/test/run-test b/xmlif/test/run-test
new file mode 100755
index 0000000..a7ddbca
--- /dev/null
+++ b/xmlif/test/run-test
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+XMLIF=${top_builddir}/xmlif/xmlif
+INPUT=${top_srcdir}/xmlif/test/test.xml
+OUTPUT=${top_builddir}/xmlif/test/test-
+
+mkdir -p ${top_builddir}/xmlif/test
+
+${XMLIF} <${INPUT} >${OUTPUT}no-condition
+${XMLIF} unrelated=condition <${INPUT} >${OUTPUT}unrelated-condition
+for condition in html pdf ps foo baz bar
+do
+ ${XMLIF} condition=${condition} <${INPUT} >${OUTPUT}${condition}
+done
+
+for test in no-condition unrelated-condition html pdf ps foo baz bar
+do
+ cmp ${top_srcdir}/xmlif/test/result-${test} ${OUTPUT}${test} || exit 1
+done
diff --git a/xmlif/test/test.xml b/xmlif/test/test.xml
new file mode 100644
index 0000000..97f14f2
--- /dev/null
+++ b/xmlif/test/test.xml
@@ -0,0 +1,29 @@
+Preamble
+<!-- this is the test on the manual page -->
+Always issue this text.
+<?xmlif if condition='html'?>
+Issue this text if 'condition=html' is given on the command line.
+<?xmlif elif condition='pdf|ps'?>
+Issue this text if 'condition=pdf' or 'condition=ps'
+is given on the command line.
+<?xmlif else?>
+Otherwise issue this text.
+<?xmlif fi?>
+Always issue this text.
+<!-- this ends the test on the manual page -->
+<?xmlif if condition='foo'?>
+Should display only if condition is foo
+<?xmlif elif condition='baz'?>
+Should display only if condition is baz
+<?xmlif else?>
+Should display only if condition is not foo and not baz
+<?xmlif fi?>
+<?xmlif if not condition='bar'?>
+Should display only if condition is not bar
+<?xmlif if cond2='on'?>
+This should be displayed only when cond2 is on.
+<?xmlif fi?>
+<?xmlif else?>
+Should display only if condition is bar
+<?xmlif fi?>
+Postamble.