diff --git a/.gitignore b/.gitignore index e811018..795debb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules/ -tests/**/counts.json +tests/**/response.json tests/**/.tokeignore diff --git a/README.md b/README.md index 12d69d5..4e92952 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ To count the lines of code of an arbitrary solution, do the following: 1. Open a terminal in the project's root 2. Run `./bin/run.sh ` -Once the test runner has finished, its results will be written to `/counts.json`. +Once the test runner has finished, its results will be written to `/response.json`. ## Run the Lines of Code Counter on a solution using Docker @@ -104,7 +104,7 @@ To count the lines of code of an arbitrary solution using the Docker image, do t 1. Open a terminal in the project's root 2. Run `./bin/run-in-docker.sh ` -Once the test runner has finished, its results will be written to `/counts.json`. +Once the test runner has finished, its results will be written to `/response.json`. ## Run the tests @@ -113,9 +113,9 @@ To run the tests to verify the behavior of the Lines of Code Counter, do the fol 1. Open a terminal in the project's root 2. Run `./bin/run-tests.sh` -These are [golden tests][golden] that compare the `counts.json` generated by running the current state of the code against the "known good" `tests//counts.json`. All files created during the test run itself are discarded. +These are [golden tests][golden] that compare the `response.json` generated by running the current state of the code against the "known good" `tests//response.json`. All files created during the test run itself are discarded. -When you've made modifications to the code that will result in a new "golden" state, you'll need to generate and commit a new `tests//counts.json` file. +When you've made modifications to the code that will result in a new "golden" state, you'll need to generate and commit a new `tests//response.json` file. ## Run the tests using Docker @@ -126,9 +126,9 @@ To run the tests to verify the behavior of the test runner using the Docker imag 1. Open a terminal in the project's root 2. Run `./bin/run-tests-in-docker.sh` -These are [golden tests][golden] that compare the `counts.json` generated by running the current state of the code against the "known good" `tests//counts.json`. All files created during the test run itself are discarded. +These are [golden tests][golden] that compare the `response.json` generated by running the current state of the code against the "known good" `tests//response.json`. All files created during the test run itself are discarded. -When you've made modifications to the code that will result in a new "golden" state, you'll need to generate and commit a new `tests//counts.json` file. +When you've made modifications to the code that will result in a new "golden" state, you'll need to generate and commit a new `tests//response.json` file. ## Credit diff --git a/bin/run-in-docker.sh b/bin/run-in-docker.sh index 327f146..8ee0950 100755 --- a/bin/run-in-docker.sh +++ b/bin/run-in-docker.sh @@ -7,46 +7,40 @@ # $1: track slug # $2: exercise slug # $3: path to solution folder -# $4: path to output directory # Output: -# Count the lines of code of the solution in the passed-in output directory. +# Count the lines of code of the solution in the passed-in solution directory. # Example: -# ./bin/run-in-docker.sh ruby two-fer path/to/solution/folder/ path/to/output/directory/ +# ./bin/run-in-docker.sh ruby two-fer path/to/solution/folder/ # If any required arguments is missing, print the usage and exit -if [[ $# -lt 4 ]]; then - echo "usage: ./bin/run-in-docker.sh track-slug exercise-slug path/to/solution/folder/ path/to/output/directory/" +if [[ $# -lt 3 ]]; then + echo "usage: ./bin/run-in-docker.sh track-slug exercise-slug path/to/solution/folder/" exit 1 fi track_slug="${1}" exercise_slug="${2}" solution_dir=$(realpath "${3%/}") -output_dir=$(realpath "${4%/}") -results_file="${output_dir}/counts.json" +response_file="${solution_dir}/response.json" container_port=9876 -# Create the output directory if it doesn't exist -mkdir -p "${output_dir}" - # Build the Docker image -docker build --progress=plain --rm -t exercism/lines-of-code-counter . +docker build --rm -t exercism/lines-of-code-counter . # Run the Docker image using the settings mimicking the production environment container_id=$(docker run \ --detach \ --publish ${container_port}:8080 \ --mount type=bind,src="${solution_dir}",dst=/solution \ - --mount type=bind,src="${output_dir}",dst=/output \ exercism/lines-of-code-counter) echo "${track_slug}/${exercise_slug}: counting lines of code..." # Call the function with the correct JSON event payload -event_json=$(jq -n --arg t "${track_slug}" --arg e "${exercise_slug}" '{track: $t, exercise: $e, solution: "/solution", output: "/output"}') -curl --silent --output /dev/null -XPOST http://localhost:${container_port}/2015-03-31/functions/function/invocations -d "${event_json}" +event_json=$(jq -n --arg t "${track_slug}" --arg e "${exercise_slug}" '{track: $t, exercise: $e, solution: "/solution"}') +curl --silent --output "${response_file}" -XPOST http://localhost:${container_port}/2015-03-31/functions/function/invocations -d "${event_json}" echo "${track_slug}/${exercise_slug}: done" diff --git a/bin/run-tests-in-docker.sh b/bin/run-tests-in-docker.sh index b6c4774..f30afaf 100755 --- a/bin/run-tests-in-docker.sh +++ b/bin/run-tests-in-docker.sh @@ -34,15 +34,19 @@ for test_dir in tests/${track_slug}/${exercise_slug}; do track_name=$(basename $(realpath "${test_dir}/../")) exercise_name=$(basename "${test_dir}") test_dir_path=$(realpath "${test_dir}") - counts_file_path="${test_dir_path}/counts.json" - expected_counts_file_path="${test_dir_path}/expected_counts.json" + response_file_path="${test_dir_path}/response.json" + expected_response_file_path="${test_dir_path}/expected_response.json" - rm -rf "${counts_file_path}" + rm -rf "${response_file_path}" - bin/run-in-docker.sh "${track_name}" "${exercise_name}" "${test_dir_path}" "${test_dir_path}" + bin/run-in-docker.sh "${track_name}" "${exercise_name}" "${test_dir_path}" - echo "${track_name}/${exercise_name}: comparing counts.json to expected_counts.json" - diff "${counts_file_path}" "${expected_counts_file_path}" + # Ensure there is a trailing newline in both files + sed -i -e '$a\' "${response_file_path}" + sed -i -e '$a\' "${expected_response_file_path}" + + echo "${track_name}/${exercise_name}: comparing response.json to expected_response.json" + diff "${response_file_path}" "${expected_response_file_path}" if [ $? -ne 0 ]; then exit_code=1 diff --git a/bin/run-tests.sh b/bin/run-tests.sh index 6d46daa..8a42a56 100755 --- a/bin/run-tests.sh +++ b/bin/run-tests.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # Synopsis: # Test the lines of code counter by running it against a predefined set of solutions @@ -33,15 +33,19 @@ for test_dir in tests/${track_slug}/${exercise_slug}; do track_name=$(basename $(realpath "${test_dir}/../")) exercise_name=$(basename "${test_dir}") test_dir_path=$(realpath "${test_dir}") - counts_file_path="${test_dir_path}/counts.json" - expected_counts_file_path="${test_dir_path}/expected_counts.json" + response_file_path="${test_dir_path}/response.json" + expected_response_file_path="${test_dir_path}/expected_response.json" - rm -rf "${counts_file_path}" + rm -rf "${response_file_path}" - bin/run.sh "${track_name}" "${exercise_name}" "${test_dir_path}" "${test_dir_path}" + bin/run.sh "${track_name}" "${exercise_name}" "${test_dir_path}" - echo "${track_name}/${exercise_name}: comparing counts.json to expected_counts.json" - diff "${counts_file_path}" "${expected_counts_file_path}" + # Ensure there is a trailing newline in both files + sed -i -e '$a\' "${response_file_path}" + sed -i -e '$a\' "${expected_response_file_path}" + + echo "${track_name}/${exercise_name}: comparing response.json to expected_response.json" + diff "${response_file_path}" "${expected_response_file_path}" if [ $? -ne 0 ]; then exit_code=1 diff --git a/bin/run.rb b/bin/run.rb index 03e97e6..33e9880 100755 --- a/bin/run.rb +++ b/bin/run.rb @@ -5,7 +5,8 @@ event = { "track" => ARGV[0], "exercise" => ARGV[1], - "solution" => ARGV[2], - "output" => ARGV[3] + "solution" => ARGV[2] } -LinesOfCodeCounter.process(event: event, context: {}) + +response = LinesOfCodeCounter.process(event: event, context: {}) +puts response.to_json diff --git a/bin/run.sh b/bin/run.sh index a4740cd..f90c006 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -7,31 +7,27 @@ # $1: track slug # $2: exercise slug # $3: path to solution folder -# $4: path to output directory # Output: -# Count the lines of code of the solution in the passed-in output directory. +# Count the lines of code of the solution in the passed-in solution directory. # Example: -# ./bin/run.sh ruby two-fer path/to/solution/folder/ path/to/output/directory/ +# ./bin/run.sh ruby two-fer path/to/solution/folder/ # If any required arguments is missing, print the usage and exit -if [[ $# -lt 4 ]]; then - echo "usage: ./bin/run.sh track-slug exercise-slug path/to/solution/folder/ path/to/output/directory/" +if [[ $# -lt 3 ]]; then + echo "usage: ./bin/run.sh track-slug exercise-slug path/to/solution/folder/" exit 1 fi track_slug="${1}" exercise_slug="${2}" solution_dir=$(realpath "${3%/}") -output_dir=$(realpath "${4%/}") - -# Create the output directory if it doesn't exist -mkdir -p "${output_dir}" +response_file="${solution_dir}/response.json" echo "${track_slug}/${exercise_slug}: counting lines of code..." # Call the function with the correct JSON event payload -ruby "./bin/run.rb" "${track_slug}" "${exercise_slug}" "${solution_dir}" "${output_dir}" +ruby "./bin/run.rb" "${track_slug}" "${exercise_slug}" "${solution_dir}" > "${response_file}" echo "${track_slug}/${exercise_slug}: done" diff --git a/lib/lines_of_code_counter/count_lines_of_code.rb b/lib/lines_of_code_counter/count_lines_of_code.rb index b4e163f..33a1396 100644 --- a/lib/lines_of_code_counter/count_lines_of_code.rb +++ b/lib/lines_of_code_counter/count_lines_of_code.rb @@ -4,12 +4,15 @@ class CountLinesOfCode initialize_with :exercise def call + File.write(ignore_file.filepath, ignore_file.content) { code: code, blanks: blanks, comments: comments, files: files } + ensure + FileUtils.rm(ignore_file.filepath) end private @@ -37,4 +40,9 @@ def files sort. to_a end + + memoize + def ignore_file + IgnoreFile.new(exercise) + end end diff --git a/lib/lines_of_code_counter/exercise.rb b/lib/lines_of_code_counter/exercise.rb index cadf8ca..e2ee54c 100644 --- a/lib/lines_of_code_counter/exercise.rb +++ b/lib/lines_of_code_counter/exercise.rb @@ -1,9 +1,10 @@ class Exercise include Mandate - attr_reader :dir + attr_reader :track, :dir - def initialize(dir) + def initialize(track, dir) + @track = track @dir = dir end diff --git a/lib/lines_of_code_counter/ignore_file.rb b/lib/lines_of_code_counter/ignore_file.rb index 6df4b0d..0c990ec 100644 --- a/lib/lines_of_code_counter/ignore_file.rb +++ b/lib/lines_of_code_counter/ignore_file.rb @@ -1,7 +1,7 @@ class IgnoreFile include Mandate - initialize_with :track, :exercise + initialize_with :exercise def filepath File.join(exercise.dir, ".tokeignore") @@ -24,8 +24,7 @@ def track_specific_rules *exercise.example_files, *exercise.exemplar_files, *exercise.editor_files, - "counts.json", - "expected_counts.json" + *test_file_rules ] end @@ -36,8 +35,15 @@ def default_rules ] end + def test_file_rules + [ + "response.json", + "expected_response.json" + ] + end + private def track_ignore_filepath - "tracks/#{track}.ignore" + "tracks/#{exercise.track}.ignore" end end diff --git a/lib/lines_of_code_counter/process_request.rb b/lib/lines_of_code_counter/process_request.rb index 9fff4c4..21adf7c 100644 --- a/lib/lines_of_code_counter/process_request.rb +++ b/lib/lines_of_code_counter/process_request.rb @@ -3,37 +3,22 @@ class ProcessRequest initialize_with :event, :content - def call - File.write(ignore_file.filepath, ignore_file.content) + def call counts = CountLinesOfCode.(exercise) - File.write(counts_filepath, counts.to_json) - # FileUtils.rm(ignore_file.filepath) + counts_json = counts.to_json + + { + statusCode: 200, + headers: { + 'Content-Length': counts_json.bytesize, + 'Content-Type': 'application/json; charset=utf-8' + }, + isBase64Encoded: false, + body: counts_json + } end - private - def track - event["track"] - end - - def solution_dir - event["solution"] - end - - def output_dir - event["output"] - end - - def counts_filepath - File.join(output_dir, "counts.json") - end - - memoize def exercise - Exercise.new(solution_dir) - end - - memoize - def ignore_file - IgnoreFile.new(track, exercise) + Exercise.new(event["track"], event["solution"]) end end diff --git a/tests/csharp/example-not-in-hidden-directory/expected_counts.json b/tests/csharp/example-not-in-hidden-directory/expected_counts.json deleted file mode 100644 index bd02ddf..0000000 --- a/tests/csharp/example-not-in-hidden-directory/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":27,"blanks":3,"comments":0,"files":["Bob.cs"]} \ No newline at end of file diff --git a/tests/csharp/example-not-in-hidden-directory/expected_response.json b/tests/csharp/example-not-in-hidden-directory/expected_response.json new file mode 100644 index 0000000..a00ba33 --- /dev/null +++ b/tests/csharp/example-not-in-hidden-directory/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":54,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":27,\"blanks\":3,\"comments\":0,\"files\":[\"Bob.cs\"]}"} diff --git a/tests/csharp/multiple-additional-files/expected_counts.json b/tests/csharp/multiple-additional-files/expected_counts.json deleted file mode 100644 index dde3f58..0000000 --- a/tests/csharp/multiple-additional-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":45,"blanks":4,"comments":0,"files":["AnotherHelper.cs","Bob.cs","Helper.cs"]} \ No newline at end of file diff --git a/tests/csharp/multiple-additional-files/expected_response.json b/tests/csharp/multiple-additional-files/expected_response.json new file mode 100644 index 0000000..b83e961 --- /dev/null +++ b/tests/csharp/multiple-additional-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":85,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":45,\"blanks\":4,\"comments\":0,\"files\":[\"AnotherHelper.cs\",\"Bob.cs\",\"Helper.cs\"]}"} diff --git a/tests/csharp/multiple-editor-files/expected_counts.json b/tests/csharp/multiple-editor-files/expected_counts.json deleted file mode 100644 index bd02ddf..0000000 --- a/tests/csharp/multiple-editor-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":27,"blanks":3,"comments":0,"files":["Bob.cs"]} \ No newline at end of file diff --git a/tests/csharp/multiple-editor-files/expected_response.json b/tests/csharp/multiple-editor-files/expected_response.json new file mode 100644 index 0000000..a00ba33 --- /dev/null +++ b/tests/csharp/multiple-editor-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":54,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":27,\"blanks\":3,\"comments\":0,\"files\":[\"Bob.cs\"]}"} diff --git a/tests/csharp/multiple-solution-files/expected_counts.json b/tests/csharp/multiple-solution-files/expected_counts.json deleted file mode 100644 index c5e491a..0000000 --- a/tests/csharp/multiple-solution-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":34,"blanks":3,"comments":0,"files":["Bob.cs","Bobby.cs"]} \ No newline at end of file diff --git a/tests/csharp/multiple-solution-files/expected_response.json b/tests/csharp/multiple-solution-files/expected_response.json new file mode 100644 index 0000000..dd64cef --- /dev/null +++ b/tests/csharp/multiple-solution-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":65,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":34,\"blanks\":3,\"comments\":0,\"files\":[\"Bob.cs\",\"Bobby.cs\"]}"} diff --git a/tests/csharp/old-test-file-name/expected_counts.json b/tests/csharp/old-test-file-name/expected_counts.json deleted file mode 100644 index bd02ddf..0000000 --- a/tests/csharp/old-test-file-name/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":27,"blanks":3,"comments":0,"files":["Bob.cs"]} \ No newline at end of file diff --git a/tests/csharp/old-test-file-name/expected_response.json b/tests/csharp/old-test-file-name/expected_response.json new file mode 100644 index 0000000..a00ba33 --- /dev/null +++ b/tests/csharp/old-test-file-name/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":54,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":27,\"blanks\":3,\"comments\":0,\"files\":[\"Bob.cs\"]}"} diff --git a/tests/csharp/single-additional-file/expected_counts.json b/tests/csharp/single-additional-file/expected_counts.json deleted file mode 100644 index ada513f..0000000 --- a/tests/csharp/single-additional-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":42,"blanks":5,"comments":0,"files":["Bob.cs","Helper.cs"]} \ No newline at end of file diff --git a/tests/csharp/single-additional-file/expected_response.json b/tests/csharp/single-additional-file/expected_response.json new file mode 100644 index 0000000..3976c13 --- /dev/null +++ b/tests/csharp/single-additional-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":66,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":42,\"blanks\":5,\"comments\":0,\"files\":[\"Bob.cs\",\"Helper.cs\"]}"} diff --git a/tests/csharp/single-editor-file/expected_counts.json b/tests/csharp/single-editor-file/expected_counts.json deleted file mode 100644 index bd02ddf..0000000 --- a/tests/csharp/single-editor-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":27,"blanks":3,"comments":0,"files":["Bob.cs"]} \ No newline at end of file diff --git a/tests/csharp/single-editor-file/expected_response.json b/tests/csharp/single-editor-file/expected_response.json new file mode 100644 index 0000000..a00ba33 --- /dev/null +++ b/tests/csharp/single-editor-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":54,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":27,\"blanks\":3,\"comments\":0,\"files\":[\"Bob.cs\"]}"} diff --git a/tests/csharp/single-solution-file/expected_counts.json b/tests/csharp/single-solution-file/expected_counts.json deleted file mode 100644 index bd02ddf..0000000 --- a/tests/csharp/single-solution-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":27,"blanks":3,"comments":0,"files":["Bob.cs"]} \ No newline at end of file diff --git a/tests/csharp/single-solution-file/expected_response.json b/tests/csharp/single-solution-file/expected_response.json new file mode 100644 index 0000000..a00ba33 --- /dev/null +++ b/tests/csharp/single-solution-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":54,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":27,\"blanks\":3,\"comments\":0,\"files\":[\"Bob.cs\"]}"} diff --git a/tests/fsharp/example-not-in-hidden-directory/expected_counts.json b/tests/fsharp/example-not-in-hidden-directory/expected_counts.json deleted file mode 100644 index 8d87383..0000000 --- a/tests/fsharp/example-not-in-hidden-directory/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":8,"blanks":4,"comments":0,"files":["Anagram.fs"]} \ No newline at end of file diff --git a/tests/fsharp/example-not-in-hidden-directory/expected_response.json b/tests/fsharp/example-not-in-hidden-directory/expected_response.json new file mode 100644 index 0000000..582f210 --- /dev/null +++ b/tests/fsharp/example-not-in-hidden-directory/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":57,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":8,\"blanks\":4,\"comments\":0,\"files\":[\"Anagram.fs\"]}"} diff --git a/tests/fsharp/multiple-additional-files/expected_counts.json b/tests/fsharp/multiple-additional-files/expected_counts.json deleted file mode 100644 index 6b49ff1..0000000 --- a/tests/fsharp/multiple-additional-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":15,"blanks":8,"comments":0,"files":["Anagram.fs","Custom.fs","MoreCustom.fs"]} \ No newline at end of file diff --git a/tests/fsharp/multiple-additional-files/expected_response.json b/tests/fsharp/multiple-additional-files/expected_response.json new file mode 100644 index 0000000..7c2084f --- /dev/null +++ b/tests/fsharp/multiple-additional-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":86,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":15,\"blanks\":8,\"comments\":0,\"files\":[\"Anagram.fs\",\"Custom.fs\",\"MoreCustom.fs\"]}"} diff --git a/tests/fsharp/multiple-editor-files/expected_counts.json b/tests/fsharp/multiple-editor-files/expected_counts.json deleted file mode 100644 index 8d87383..0000000 --- a/tests/fsharp/multiple-editor-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":8,"blanks":4,"comments":0,"files":["Anagram.fs"]} \ No newline at end of file diff --git a/tests/fsharp/multiple-editor-files/expected_response.json b/tests/fsharp/multiple-editor-files/expected_response.json new file mode 100644 index 0000000..582f210 --- /dev/null +++ b/tests/fsharp/multiple-editor-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":57,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":8,\"blanks\":4,\"comments\":0,\"files\":[\"Anagram.fs\"]}"} diff --git a/tests/fsharp/multiple-solution-files/expected_counts.json b/tests/fsharp/multiple-solution-files/expected_counts.json deleted file mode 100644 index 71c412e..0000000 --- a/tests/fsharp/multiple-solution-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":13,"blanks":5,"comments":0,"files":["Anagram.fs","Helper.fs"]} \ No newline at end of file diff --git a/tests/fsharp/multiple-solution-files/expected_response.json b/tests/fsharp/multiple-solution-files/expected_response.json new file mode 100644 index 0000000..90193cd --- /dev/null +++ b/tests/fsharp/multiple-solution-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":70,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":13,\"blanks\":5,\"comments\":0,\"files\":[\"Anagram.fs\",\"Helper.fs\"]}"} diff --git a/tests/fsharp/old-test-name/expected_counts.json b/tests/fsharp/old-test-name/expected_counts.json deleted file mode 100644 index 8d87383..0000000 --- a/tests/fsharp/old-test-name/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":8,"blanks":4,"comments":0,"files":["Anagram.fs"]} \ No newline at end of file diff --git a/tests/fsharp/old-test-name/expected_response.json b/tests/fsharp/old-test-name/expected_response.json new file mode 100644 index 0000000..582f210 --- /dev/null +++ b/tests/fsharp/old-test-name/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":57,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":8,\"blanks\":4,\"comments\":0,\"files\":[\"Anagram.fs\"]}"} diff --git a/tests/fsharp/single-additional-file/expected_counts.json b/tests/fsharp/single-additional-file/expected_counts.json deleted file mode 100644 index f6cb7f6..0000000 --- a/tests/fsharp/single-additional-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":11,"blanks":6,"comments":0,"files":["Anagram.fs","Custom.fs"]} \ No newline at end of file diff --git a/tests/fsharp/single-additional-file/expected_response.json b/tests/fsharp/single-additional-file/expected_response.json new file mode 100644 index 0000000..5998a33 --- /dev/null +++ b/tests/fsharp/single-additional-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":70,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":11,\"blanks\":6,\"comments\":0,\"files\":[\"Anagram.fs\",\"Custom.fs\"]}"} diff --git a/tests/fsharp/single-editor-file/expected_counts.json b/tests/fsharp/single-editor-file/expected_counts.json deleted file mode 100644 index 8d87383..0000000 --- a/tests/fsharp/single-editor-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":8,"blanks":4,"comments":0,"files":["Anagram.fs"]} \ No newline at end of file diff --git a/tests/fsharp/single-editor-file/expected_response.json b/tests/fsharp/single-editor-file/expected_response.json new file mode 100644 index 0000000..582f210 --- /dev/null +++ b/tests/fsharp/single-editor-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":57,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":8,\"blanks\":4,\"comments\":0,\"files\":[\"Anagram.fs\"]}"} diff --git a/tests/fsharp/single-solution-file/expected_counts.json b/tests/fsharp/single-solution-file/expected_counts.json deleted file mode 100644 index 8d87383..0000000 --- a/tests/fsharp/single-solution-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":8,"blanks":4,"comments":0,"files":["Anagram.fs"]} \ No newline at end of file diff --git a/tests/fsharp/single-solution-file/expected_response.json b/tests/fsharp/single-solution-file/expected_response.json new file mode 100644 index 0000000..582f210 --- /dev/null +++ b/tests/fsharp/single-solution-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":57,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":8,\"blanks\":4,\"comments\":0,\"files\":[\"Anagram.fs\"]}"} diff --git a/tests/track-without-config/example-not-in-hidden-directory/expected_counts.json b/tests/track-without-config/example-not-in-hidden-directory/expected_counts.json deleted file mode 100644 index 702283e..0000000 --- a/tests/track-without-config/example-not-in-hidden-directory/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":4,"blanks":0,"comments":0,"files":["leap.pony"]} \ No newline at end of file diff --git a/tests/track-without-config/example-not-in-hidden-directory/expected_response.json b/tests/track-without-config/example-not-in-hidden-directory/expected_response.json new file mode 100644 index 0000000..70d3a9a --- /dev/null +++ b/tests/track-without-config/example-not-in-hidden-directory/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":56,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":4,\"blanks\":0,\"comments\":0,\"files\":[\"leap.pony\"]}"} diff --git a/tests/track-without-config/multiple-additional-files/expected_counts.json b/tests/track-without-config/multiple-additional-files/expected_counts.json deleted file mode 100644 index 702283e..0000000 --- a/tests/track-without-config/multiple-additional-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":4,"blanks":0,"comments":0,"files":["leap.pony"]} \ No newline at end of file diff --git a/tests/track-without-config/multiple-additional-files/expected_response.json b/tests/track-without-config/multiple-additional-files/expected_response.json new file mode 100644 index 0000000..70d3a9a --- /dev/null +++ b/tests/track-without-config/multiple-additional-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":56,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":4,\"blanks\":0,\"comments\":0,\"files\":[\"leap.pony\"]}"} diff --git a/tests/track-without-config/multiple-editor-files/expected_counts.json b/tests/track-without-config/multiple-editor-files/expected_counts.json deleted file mode 100644 index 702283e..0000000 --- a/tests/track-without-config/multiple-editor-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":4,"blanks":0,"comments":0,"files":["leap.pony"]} \ No newline at end of file diff --git a/tests/track-without-config/multiple-editor-files/expected_response.json b/tests/track-without-config/multiple-editor-files/expected_response.json new file mode 100644 index 0000000..70d3a9a --- /dev/null +++ b/tests/track-without-config/multiple-editor-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":56,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":4,\"blanks\":0,\"comments\":0,\"files\":[\"leap.pony\"]}"} diff --git a/tests/track-without-config/multiple-solution-files/expected_counts.json b/tests/track-without-config/multiple-solution-files/expected_counts.json deleted file mode 100644 index 9f43a5e..0000000 --- a/tests/track-without-config/multiple-solution-files/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":7,"blanks":0,"comments":0,"files":["leap.pony","math.pony"]} \ No newline at end of file diff --git a/tests/track-without-config/multiple-solution-files/expected_response.json b/tests/track-without-config/multiple-solution-files/expected_response.json new file mode 100644 index 0000000..a5d9d82 --- /dev/null +++ b/tests/track-without-config/multiple-solution-files/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":68,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":7,\"blanks\":0,\"comments\":0,\"files\":[\"leap.pony\",\"math.pony\"]}"} diff --git a/tests/track-without-config/single-additional-file/expected_counts.json b/tests/track-without-config/single-additional-file/expected_counts.json deleted file mode 100644 index 702283e..0000000 --- a/tests/track-without-config/single-additional-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":4,"blanks":0,"comments":0,"files":["leap.pony"]} \ No newline at end of file diff --git a/tests/track-without-config/single-additional-file/expected_response.json b/tests/track-without-config/single-additional-file/expected_response.json new file mode 100644 index 0000000..70d3a9a --- /dev/null +++ b/tests/track-without-config/single-additional-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":56,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":4,\"blanks\":0,\"comments\":0,\"files\":[\"leap.pony\"]}"} diff --git a/tests/track-without-config/single-editor-file/expected_counts.json b/tests/track-without-config/single-editor-file/expected_counts.json deleted file mode 100644 index 702283e..0000000 --- a/tests/track-without-config/single-editor-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":4,"blanks":0,"comments":0,"files":["leap.pony"]} \ No newline at end of file diff --git a/tests/track-without-config/single-editor-file/expected_response.json b/tests/track-without-config/single-editor-file/expected_response.json new file mode 100644 index 0000000..70d3a9a --- /dev/null +++ b/tests/track-without-config/single-editor-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":56,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":4,\"blanks\":0,\"comments\":0,\"files\":[\"leap.pony\"]}"} diff --git a/tests/track-without-config/single-solution-file/expected_counts.json b/tests/track-without-config/single-solution-file/expected_counts.json deleted file mode 100644 index 702283e..0000000 --- a/tests/track-without-config/single-solution-file/expected_counts.json +++ /dev/null @@ -1 +0,0 @@ -{"code":4,"blanks":0,"comments":0,"files":["leap.pony"]} \ No newline at end of file diff --git a/tests/track-without-config/single-solution-file/expected_response.json b/tests/track-without-config/single-solution-file/expected_response.json new file mode 100644 index 0000000..70d3a9a --- /dev/null +++ b/tests/track-without-config/single-solution-file/expected_response.json @@ -0,0 +1 @@ +{"statusCode":200,"headers":{"Content-Length":56,"Content-Type":"application/json; charset=utf-8"},"isBase64Encoded":false,"body":"{\"code\":4,\"blanks\":0,\"comments\":0,\"files\":[\"leap.pony\"]}"}