From e8a2bd35e2f4ed35a08aa7322800ebb5dd3fa519 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Sat, 21 May 2016 18:54:41 +0200 Subject: [PATCH] Test hocr-merge-dc, #22 (#23) * test hocr-merge-dc * pass not fail the skipped test --- test/{legacy => hocr-merge-dc}/dcsample.xml | 0 test/{legacy => hocr-merge-dc}/dcsample2.xml | 0 test/hocr-merge-dc/hocr-merge-dc.tsht | 13 +++++++++++++ test/hocr-pdf/test-hocr-pdf.tsht | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) rename test/{legacy => hocr-merge-dc}/dcsample.xml (100%) rename test/{legacy => hocr-merge-dc}/dcsample2.xml (100%) create mode 100644 test/hocr-merge-dc/hocr-merge-dc.tsht diff --git a/test/legacy/dcsample.xml b/test/hocr-merge-dc/dcsample.xml similarity index 100% rename from test/legacy/dcsample.xml rename to test/hocr-merge-dc/dcsample.xml diff --git a/test/legacy/dcsample2.xml b/test/hocr-merge-dc/dcsample2.xml similarity index 100% rename from test/legacy/dcsample2.xml rename to test/hocr-merge-dc/dcsample2.xml diff --git a/test/hocr-merge-dc/hocr-merge-dc.tsht b/test/hocr-merge-dc/hocr-merge-dc.tsht new file mode 100644 index 0000000..ed91b00 --- /dev/null +++ b/test/hocr-merge-dc/hocr-merge-dc.tsht @@ -0,0 +1,13 @@ +#!/usr/bin/env tsht + +plan 4 + +hocr_file='../legacy/sample.html' + +output=$(hocr-merge-dc dcsample2.xml "$hocr_file") +not_ok "$?" "Command succeeded" +# ok "$output" "Output produced" +match "name='DC.title' value='Nomad'" "$(cat "$hocr_file")" +not_match "name='DC.title' value='UKOLN'" "$(cat "$hocr_file")" +match 'name="DC.title" value="UKOLN"' "$output" +# match " diff --git a/test/hocr-pdf/test-hocr-pdf.tsht b/test/hocr-pdf/test-hocr-pdf.tsht index de09825..ab5e747 100755 --- a/test/hocr-pdf/test-hocr-pdf.tsht +++ b/test/hocr-pdf/test-hocr-pdf.tsht @@ -4,7 +4,7 @@ work="445442158_0126" which pdfgrep wget >/dev/null if [[ "$?" != 0 ]];then - fail "Test requires 'pdfgrep' and 'wget' installed" + pass "Test requires 'pdfgrep' and 'wget' installed" exit fi exec_ok wget --quiet "http://digi.bib.uni-mannheim.de/fileadmin/digi/445442158/hocr/${work}.hocr"