Regression tests for autopkgtest.
[tabix.git] / debian / tests / with-example-data
diff --git a/debian/tests/with-example-data b/debian/tests/with-example-data
new file mode 100755 (executable)
index 0000000..6af6ecf
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+
+# Create a temporary file
+TABIXDATA=$(mktemp)
+
+# Uncompress example data
+zcat /usr/share/doc/tabix/examples/example.gtf.gz > $TABIXDATA
+
+# Compress example data with bgzip
+bgzip $TABIXDATA
+
+# Index with tabix
+tabix $TABIXDATA.gz
+
+# Extract with tabix the he features on chromosome 1 whose coordinates overlap
+# the interval 150,309–150,309.
+tabix $TABIXDATA.gz chr1:150309-150309 > $TABIXDATA.out
+
+# Reference result at the bottom of this file
+grep H\AVANA /usr/share/doc/tabix/README.test > $TABIXDATA.ref
+
+# No difference ?
+diff $TABIXDATA.ref $TABIXDATA.out
+
+# Clean
+rm $TABIXDATA.gz $TABIXDATA.gz.tbi $TABIXDATA.out $TABIXDATA.ref