From 72fb813b56c42335985ef47d9d2a23ebc456eae0 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 16 Sep 2003 13:58:00 +0000 Subject: [PATCH] Test for filter bug in config --- test/config/Makefile.am | 8 ++++---- test/config/m.abs | 50 +++++++++++++++++++++++++++++++++++++++++++++++ test/config/m.flt | 34 ++++++++++++++++++++++++++++++++ test/config/m.rec | 4 ++++ test/config/test2.sh | 7 +++++++ 5 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 test/config/m.abs create mode 100644 test/config/m.flt create mode 100644 test/config/m.rec create mode 100755 test/config/test2.sh diff --git a/test/config/Makefile.am b/test/config/Makefile.am index 35c7e9f..5139392 100644 --- a/test/config/Makefile.am +++ b/test/config/Makefile.am @@ -1,6 +1,6 @@ -# $Id: Makefile.am,v 1.1 2003-09-16 12:18:25 adam Exp $ +# $Id: Makefile.am,v 1.2 2003-09-16 13:58:00 adam Exp $ -check_SCRIPTS = test1.sh -TESTS = test1.sh +check_SCRIPTS = test1.sh test2.sh +TESTS = test1.sh test2.sh -EXTRA_DIST = zebra.cfg $(check_SCRIPTS) g.grs g.abs +EXTRA_DIST = zebra.cfg $(check_SCRIPTS) g.rec g.abs m.rec m.flt m.rec diff --git a/test/config/m.abs b/test/config/m.abs new file mode 100644 index 0000000..e88200f --- /dev/null +++ b/test/config/m.abs @@ -0,0 +1,50 @@ +# $Id: m.abs,v 1.1 2003-09-16 13:58:00 adam Exp $ + +name my +attset bib1.att +tagset meta.tag +varset var1.var + +esetname F @ +esetname B meta-b.est + +maptab meta-usmarc.map + +all any + +elm (2,1) title Title:w,Title:p,Title:s +elm dc_title title Title:w,Title:p,Title:s +elm (2,2) creator Author:w,Author:p +elm dc_creator creator Author:w,Author:p +elm dc_publisher publisher Author:w,Author:p,Publisher:w,Publisher:p +elm author-publisher author-publisher author-publisher:p,author-publisher:w +elm (2,21) subject Subject-heading +elm dc_subject subject Subject-heading:w,Subject-heading:p +elm dc_subject_s_DBC subject Subject-heading:w,Subject-heading:p +elm dc_subject_s_dkbib_DBCM subject Subject-heading:w,Subject-heading:p +elm dc_subject_s_dkbib_DBCF subject Subject-heading:w,Subject-heading:p +elm dc_subject_s_dkbib_DBCS subject Subject-heading:w,Subject-heading:p +elm dc_subject_s_DK5 subject_DK5 Local-classification:w,Local-classification:p +elm (2,17) description abstract +elm dc_description description abstract +elm (2,31) publisher Publisher +elm (2,32) contributor - +elm (2,4) date Date +elm treatment_date date Date,Date:s +elm (2,22) type Content-type,Content-type:s +elm (2,27) format Material-type +elm (2,28) identifier Record-source +elm dc_identifier_s_url identifier_url Record-source,Record-source:0 +elm dc_identifier_s_purl identifier_purl Record-source +elm dc_identifier_s_urn identifier_urn Record-source +elm dc_identifier_s_isbn identifier_isbn Record-source,ISBN +elm (2,33) source - +elm (2,20) language Code-language +elm dc_language_s_ISO_639_2_B_1998 language Code-language +elm (2,30) relation - +elm (2,34) coverage - +elm (2,29) rights - + +# These tags are required by Zebra for GRS-1 generation +elm (1,10) rank - +elm (1,14) localControlNumber Local-number diff --git a/test/config/m.flt b/test/config/m.flt new file mode 100644 index 0000000..883da34 --- /dev/null +++ b/test/config/m.flt @@ -0,0 +1,34 @@ +# +# DEF portal input filter +# + +// { begin record meta; set type ""; set AUTHOR ""; set PUBLISHER "" } +/<\/meta>/ { + data -element author-publisher "$AUTHOR XXX $PUBLISHER"; end record + } + + +// { + if {$scheme != ""} { set tag "$tag-s-$scheme" }; + if {$lang != ""} { set tag "$tag-l-$lang" }; + regsub -all {[\. -/:]} $tag "_" tag; + begin element $tag; + end context; + begin context content; + } + +/lang=\"/ BODY /\"/ { set lang $1 } + +/scheme=\"/ BODY /\"/ { set scheme $1 } + +CONTEXT {content} + +/<\/[aA]>/ { data $0 } + +/<\/[^>]*>/ { end element; end context } + +/./ { if {$tag == "dc_creator"} { append AUTHOR $0}; if {$tag == "dc_publisher"} { append PUBLISHER $0}; data $0 } diff --git a/test/config/m.rec b/test/config/m.rec new file mode 100644 index 0000000..c731df1 --- /dev/null +++ b/test/config/m.rec @@ -0,0 +1,4 @@ + +film +2002-04-10 + diff --git a/test/config/test2.sh b/test/config/test2.sh new file mode 100755 index 0000000..3357251 --- /dev/null +++ b/test/config/test2.sh @@ -0,0 +1,7 @@ +#!/bin/sh +if ../../index/zebraidx -V|grep Tcl >/dev/null; then + ../../index/zebraidx init + ../../index/zebraidx -s -t grs.tcl.m update m.rec | grep tag:dc:subject >/dev/null +else + exit 0 +fi -- 1.7.10.4