summaryrefslogtreecommitdiff
path: root/runatest
diff options
context:
space:
mode:
authorLars Wirzenius <lwirzenius@wikimedia.org>2019-08-18 13:51:37 +0200
committerLars Wirzenius <lwirzenius@wikimedia.org>2019-08-18 13:51:37 +0200
commitc90fdd956dcf119c658bfe1e25ae2851e7c6836f (patch)
tree518e9238f5f20a25d94387ba0f012ce56fe971c0 /runatest
parentfaa2704609bc61ffa0b6ca1672fb48579afc6868 (diff)
downloadwikitexttest-c90fdd956dcf119c658bfe1e25ae2851e7c6836f.tar.gz
Add: first draft of test scripts
Diffstat (limited to 'runatest')
-rwxr-xr-xrunatest21
1 files changed, 21 insertions, 0 deletions
diff --git a/runatest b/runatest
new file mode 100755
index 0000000..1321026
--- /dev/null
+++ b/runatest
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -eu
+set -o pipefail
+
+
+normalize()
+{
+ pandoc -f "html" -t json "$1" | jq .
+}
+
+
+
+engine="$1"
+wiki="$2"
+html="$3"
+output="$4"
+diff="$5"
+
+"$engine" < "$wiki" > "$output"
+diff -u <(normalize "$html") <(normalize "$output") > "$diff"