Add --strip-comments option

This commit is contained in:
liquidaty authored and Mattias Wadman committed 2024-02-24 18:58:53 +01:00
1 parent e659a5e508
commit 8b479ca229
5 files changed
+24 -7

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