]> git.g-eek.se Git - interimap.git/commitdiff
test suite: import+dump before comparing SQLite dumps.
authorGustav Eek <gustav.eek@fripost.org>
Thu, 27 Jun 2019 19:03:23 +0000 (21:03 +0200)
committerGuilhem Moulin <guilhem@fripost.org>
Thu, 27 Jun 2019 19:20:31 +0000 (21:20 +0200)
The dumping quoting style differ between sqlite versions. Compensate
with re-dumping also the reference file

tests/00-db-migration-0-to-1/run

index e4eb7702e6f0c61db39a0b6814e4b28c8f6f4ad4..757fe0409ef5b10d86ed0bdc49191dc071ba666e 100644 (file)
@@ -18,9 +18,16 @@ sqlite3 "$XDG_DATA_HOME/interimap/remote.db" >"$TMPDIR/dump.sql" <<-EOF
        .dump
 EOF
 
+# re-import and dump the expected dump to work around SQLite format
+# differences across versions
+sqlite3 "$XDG_DATA_HOME/interimap/remote2.db" <"$TESTDIR/after.sql"
+sqlite3 "$XDG_DATA_HOME/interimap/remote2.db" >"$TMPDIR/dump-expected.sql" <<-EOF
+       .dump
+EOF
+
 # XXX need 'user_version' PRAGMA in the dump for future migrations
 # http://sqlite.1065341.n5.nabble.com/dump-command-and-user-version-td101228.html
 diff -u --label="a/dump.sql" --label="b/dump.sql" \
-    "$TESTDIR/after.sql" "$TMPDIR/dump.sql"
+    "$TMPDIR/dump-expected.sql" "$TMPDIR/dump.sql"
 
 # vim: set filetype=sh :