From: Niels Möller Date: Wed, 30 Oct 2002 22:12:55 +0000 (+0100) Subject: New tests for transport output. X-Git-Tag: nettle_1.7_release_20030311~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a096a2b2e7162b1b2f5f43787ab333adb7b2e9ad;p=thirdparty%2Fnettle.git New tests for transport output. Rev: src/nettle/examples/sexp-conv-test:1.5 --- diff --git a/examples/sexp-conv-test b/examples/sexp-conv-test index 48ca5acb..6b61f84a 100755 --- a/examples/sexp-conv-test +++ b/examples/sexp-conv-test @@ -31,6 +31,22 @@ test_advanced () { fi } +test_transport () { + echo "$1" > test.in + if ./sexp-conv -s transport test1.out ; then + true + else + exit 1 + fi + echo "$2" > test2.out + + if cmp test1.out test2.out ; then + true + else + exit 1; + fi +} + test_canonical () { echo "$1" > test.in if ./sexp-conv -s canonical test1.out ; then @@ -64,9 +80,15 @@ test_advanced '; comment test_advanced '(foo[bar]foo)' '(foo [bar]foo)' +test_transport '0:' '{MDo=}' +test_transport '()' '{KCk=}' +test_transport 'foo' '{Mzpmb28=}' +test_transport '(foo bar baz)' '{KDM6Zm9vMzpiYXIzOmJheik=}' + test_canonical '""' '0:' test_canonical 'foo' '3:foo' test_canonical 'fooooooooooo' '12:fooooooooooo' test_canonical 'fooooooooo' '10:fooooooooo' test_canonical '(foo bar baz)' '(3:foo3:bar3:baz)' + exit 0