updated test ns
authorTim L <lebot@rpi.edu>
Mon, 29 Apr 2013 14:37:13 +0000
changeset 6362 9328abfce732
parent 6361 13446fb1c7ca
child 6363 2cc8b617c25d
updated test ns
namespace/bin/test-w3org.sh
--- a/namespace/bin/test-w3org.sh	Mon Apr 29 10:21:05 2013 -0400
+++ b/namespace/bin/test-w3org.sh	Mon Apr 29 14:37:13 2013 +0000
@@ -1,5 +1,9 @@
 #!/bin/bash
 
+if [ ! -d test ]; then
+   mkdir test
+fi
+
 function test_ns {
    mime="$1"
    url="$2"
@@ -7,19 +11,20 @@
 
    base=`basename $url`
    ext='unk'
+   pad=''
    if [   "$mime" == 'text/turtle'         ]; then
-      ext='ttl'
+      ext='ttl'; pad='        '
    elif [ "$mime" == 'application/rdf+xml' ]; then
-      ext='rdf'
+      ext='rdf'; pad=''
    elif [ "$mime" == 'application/xml'     ]; then
-      ext='xsd'
+      ext='xsd'; pad='    '
    fi
    curl -sH "Accept: $mime" -L $url > test/$base.$ext
-   diff test/$base.$ext prov.ttl >& /dev/null
-   if [ $? ]; then
-      echo FAIL: $mime from $url does not match $goal
+   diffs=`diff --brief test/$base.$ext $goal`
+   if [ ${#diffs} -gt 0 ]; then
+      echo "FAIL: $mime $pad from $url does not match $goal"
    else
-      echo PASS: $mime from $url matches $goal
+      echo "pass: $mime $pad from $url matches $goal"
    fi
 }
 
@@ -37,3 +42,8 @@
 test_ns 'application/rdf+xml' http://www.w3.org/ns/prov-o-inverses  prov-o-inverses.owl
 echo
 
+test_ns 'text/turtle'         http://www.w3.org/ns/prov-links  prov-links.ttl
+test_ns 'application/rdf+xml' http://www.w3.org/ns/prov-links  prov-links.owl
+test_ns 'application/xml'     http://www.w3.org/ns/prov-links  prov-links.xsd
+echo
+