diff --git a/Dockerfile b/Dockerfile index b700cce..f4fbe9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,4 +23,4 @@ USER duster RUN git clean -dfxq RUN cargo build RUN npm link dustjs-linkedin -CMD /home/duster/duster/js/run_compliance_suite.bash +ENTRYPOINT ["/home/duster/duster/js/run_compliance_suite.bash"] diff --git a/js/run_dockerized_compliance_suite.bash b/js/run_dockerized_compliance_suite.bash new file mode 100755 index 0000000..10de8d7 --- /dev/null +++ b/js/run_dockerized_compliance_suite.bash @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# +# Runs the full suite of tests against LinkedIn DustJS and duster to compare the result +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +cd "$DIR/../" +docker build -t duster . && docker run --rm -i -t duster "${@}" diff --git a/js/test_cases/surrounding_whitespace/README.md b/js/test_cases/surrounding_whitespace/README.md new file mode 100644 index 0000000..f112c8c --- /dev/null +++ b/js/test_cases/surrounding_whitespace/README.md @@ -0,0 +1 @@ +Through experimentation I have determined that DustJS erases all preceding whitespace (spaces, tabs, and newlines) but only trims trailing newlines. diff --git a/js/test_cases/surrounding_whitespace/input1.json b/js/test_cases/surrounding_whitespace/input1.json new file mode 100644 index 0000000..ad7288d --- /dev/null +++ b/js/test_cases/surrounding_whitespace/input1.json @@ -0,0 +1 @@ +{"name": "Bob"} diff --git a/js/test_cases/surrounding_whitespace/main.dust b/js/test_cases/surrounding_whitespace/main.dust new file mode 100644 index 0000000..65a50e2 --- /dev/null +++ b/js/test_cases/surrounding_whitespace/main.dust @@ -0,0 +1,9 @@ + + + + + Hello {name}! + + + +