diff --git a/testsuite/sexp-conv-test b/testsuite/sexp-conv-test
index 625e8784a86d853936e2b93cef775f7c85ba698c..9420284538df1cbd23d5e4d71ba1449412da79a8 100755
--- a/testsuite/sexp-conv-test
+++ b/testsuite/sexp-conv-test
@@ -31,6 +31,22 @@ test_advanced () {
     fi
 }
 
+test_advanced_hex () {
+    echo $n "$1$c" > test.in
+    if ../tools/sexp-conv -s hex <test.in >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_transport () {
     echo $n "$1$c" > test.in
     if ../tools/sexp-conv -s transport <test.in >test1.out ; then
@@ -80,6 +96,11 @@ test_advanced '; comment
 
 test_advanced '(foo[bar]foo)' '(foo [bar]foo)'
 
+test_advanced '(#aabb#)' '(|qrs=|)'
+test_advanced '(|qrs=|)' '(|qrs=|)'
+test_advanced_hex '(|qrs=|)' '(#aabb#)'
+test_advanced_hex '(#aabb#)' '(#aabb#)'
+
 test_transport '0:' '{MDo=}'
 test_transport '()' '{KCk=}'
 test_transport 'foo' '{Mzpmb28=}'