Python: Add test for string encoding dataset check

Note that this test checks that the current setup creates dataset check
violations. A later commit will fix this (and flip the negation in the
test).
This commit is contained in:
Taus
2024-10-18 14:59:58 +00:00
parent c8d420ec57
commit d01593e571
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
"\uD800"
"?"

View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -Eeuo pipefail # see https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -x
CODEQL=${CODEQL:-codeql}
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$SCRIPTDIR"
rm -rf db
$CODEQL database create db --language python --source-root repo_dir/
# Note the negation in front -- it witnesses the fact that currently the dataset check FAILS.
! $CODEQL dataset check db/db-python
echo "Test successfully completed."