summaryrefslogtreecommitdiffstats
path: root/src/updates/gwenview_1.4_osdformat_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/updates/gwenview_1.4_osdformat_test.sh')
-rwxr-xr-xsrc/updates/gwenview_1.4_osdformat_test.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/updates/gwenview_1.4_osdformat_test.sh b/src/updates/gwenview_1.4_osdformat_test.sh
new file mode 100755
index 0000000..ed555d7
--- /dev/null
+++ b/src/updates/gwenview_1.4_osdformat_test.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+check() {
+ cat > src.txt <<EOF
+$1
+EOF
+ cat > tmp.txt <<EOF
+$2
+EOF
+ sort tmp.txt > wanted.txt
+ ./gwenview_1.4_osdformat.sh < src.txt | sort > dst.txt
+ if diff -uwB --brief wanted.txt dst.txt ; then
+ echo ok
+ else
+ echo "
+--------------
+# From:
+$1
+# To:
+$2
+# Got:
+"
+ cat dst.txt
+ echo "# Wanted:"
+ cat wanted.txt
+ echo "
+--------------
+"
+ fi
+}
+
+check "osd mode=0" "osdFormat="
+check "osd mode=1" "osdFormat=%p"
+check "osd mode=2" "osdFormat=%c"
+check "osd mode=3" "osdFormat=%p\\n%c"
+check "osd mode=3
+something else" "osdFormat=%p\\n%c
+something else"
+check "osd mode=4
+free output format=zog\\nzog" "osdFormat=zog\\nzog"