Add --strip-comments option

This commit is contained in:
liquidaty authored and Nicolas Williams committed 2023-07-09 21:27:08 -05:00
1 parent b2e7eaff99
commit 80e9bea3a8
5 files changed
+25 -8

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
. "${0%/*}/setup" "$@"
if [ "$(echo '{"hi":"there"/*comment*/}' | $VALGRIND $Q $JQ --strip-comments '.hi')" != '"there"' ]; then
echo "C-style comment test failed"
exit 1
fi
if [ "$(printf '{"hi"://comment\n"there"}' | $VALGRIND $Q $JQ --strip-comments '.hi')" != '"there"' ]; then
echo "C++-style comment test failed"
exit 1
fi
exit 0