From c9a3adf28f519f189c11fd2e46a01530360a191b Mon Sep 17 00:00:00 2001 From: David Chambers Date: Sun, 25 Mar 2018 18:04:19 +0200 Subject: [PATCH] integrate sanctuary-scripts --- .config | 5 + .eslintignore | 2 + .eslintrc.json | 14 ++ .npmrc | 1 + .travis.yml | 8 +- CONTRIBUTING.md | 24 ++ LICENSE | 2 +- Makefile | 34 --- README.md | 4 +- package.json | 10 +- scripts/doctest | 0 scripts/generate-readme | 0 scripts/test | 4 + test/amd/results.js | 4 - test/amd/results.json | 11 + test/bin/results.js | 4 - test/bin/results.json | 11 + test/commonjs/exports/results.js | 4 - test/commonjs/exports/results.json | 11 + test/commonjs/module.exports/results.js | 4 - test/commonjs/module.exports/results.json | 11 + test/commonjs/require/results.js | 4 - test/commonjs/require/results.json | 11 + test/commonjs/strict/results.js | 4 - test/commonjs/strict/results.json | 11 + test/exceptions/results.js | 31 --- test/exceptions/results.json | 92 ++++++++ test/fantasy-land/results.js | 4 - test/fantasy-land/results.json | 11 + test/harmony/results.js | 7 - test/harmony/results.json | 7 + test/index.js | 2 +- test/line-endings/results.js | 4 - test/line-endings/results.json | 11 + test/shared/results.js | 98 -------- test/shared/results.json | 263 ++++++++++++++++++++++ test/statements/results.js | 10 - test/statements/results.json | 29 +++ test/transcribe/results.js | 4 - test/transcribe/results.json | 11 + 40 files changed, 555 insertions(+), 227 deletions(-) create mode 100644 .config create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .npmrc create mode 100644 CONTRIBUTING.md delete mode 100644 Makefile create mode 100755 scripts/doctest create mode 100755 scripts/generate-readme create mode 100755 scripts/test delete mode 100644 test/amd/results.js create mode 100644 test/amd/results.json delete mode 100644 test/bin/results.js create mode 100644 test/bin/results.json delete mode 100644 test/commonjs/exports/results.js create mode 100644 test/commonjs/exports/results.json delete mode 100644 test/commonjs/module.exports/results.js create mode 100644 test/commonjs/module.exports/results.json delete mode 100644 test/commonjs/require/results.js create mode 100644 test/commonjs/require/results.json delete mode 100644 test/commonjs/strict/results.js create mode 100644 test/commonjs/strict/results.json delete mode 100644 test/exceptions/results.js create mode 100644 test/exceptions/results.json delete mode 100644 test/fantasy-land/results.js create mode 100644 test/fantasy-land/results.json delete mode 100644 test/harmony/results.js create mode 100644 test/harmony/results.json delete mode 100644 test/line-endings/results.js create mode 100644 test/line-endings/results.json delete mode 100644 test/shared/results.js create mode 100644 test/shared/results.json delete mode 100644 test/statements/results.js create mode 100644 test/statements/results.json delete mode 100644 test/transcribe/results.js create mode 100644 test/transcribe/results.json diff --git a/.config b/.config new file mode 100644 index 00000000..77639fdf --- /dev/null +++ b/.config @@ -0,0 +1,5 @@ +repo-owner = davidchambers +repo-name = doctest +author-name = David Chambers +source-files = lib/*.js +version-tag-prefix = diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..8a33c7a4 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +/test/**/*.js +!/test/index.js diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..57c2c309 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,14 @@ +{ + "root": true, + "extends": ["./node_modules/sanctuary-style/eslint-es3.json"], + "env": {"node": true}, + "overrides": [ + { + "files": ["lib/doctest.js"], + "rules": { + "no-multiple-empty-lines": ["error", {"max": 2, "maxEOF": 0}], + "spaced-comment": ["error", "always", {"markers": ["/"]}] + } + } + ] +} diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..43c97e71 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/.travis.yml b/.travis.yml index caf3c7cf..e284104a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ node_js: - "4" - "6" - "8" -install: - - make setup -script: - - make test lint +before_install: + - git fetch origin refs/heads/master:refs/heads/master + - if [[ "$TRAVIS_PULL_REQUEST_BRANCH" ]] ; then git checkout -b "$TRAVIS_PULL_REQUEST_BRANCH" ; fi + - if [[ "$TRAVIS_NODE_VERSION" == 4 ]] ; then npm install --global npm@3.x.x ; fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..73f11cf1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,24 @@ +# Contributing + +1. Update local master branch: + + $ git checkout master + $ git pull upstream master + +2. Create feature branch: + + $ git checkout -b feature-x + +3. Make one or more atomic commits, and ensure that each commit has a + descriptive commit message. Commit messages should be line wrapped + at 72 characters. + +4. Run `npm test`, and address any errors. Preferably, fix commits in place + using `git rebase` or `git commit --amend` to make the changes easier to + review. + +5. Push: + + $ git push origin feature-x + +6. Open a pull request. diff --git a/LICENSE b/LICENSE index 6a318078..10b79962 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 - Copyright (c) 2012..2016 David Chambers + Copyright (c) 2016 David Chambers Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long diff --git a/Makefile b/Makefile deleted file mode 100644 index fc32b181..00000000 --- a/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -ESLINT = node_modules/.bin/eslint --config node_modules/sanctuary-style/eslint-es3.json --env node -XYZ = node_modules/.bin/xyz --message X.Y.Z --tag X.Y.Z --repo git@github.com:davidchambers/doctest.git - - -.PHONY: all -all: - - -.PHONY: lint -lint: - $(ESLINT) \ - -- lib/command.js - $(ESLINT) \ - --rule 'no-multiple-empty-lines: [error, {max: 2, maxEOF: 0}]' \ - --rule 'spaced-comment: [error, always, {markers: ["/"]}]' \ - -- lib/doctest.js - $(ESLINT) \ - --rule 'max-len: [off]' \ - -- test/index.js - - -.PHONY: release-major release-minor release-patch -release-major release-minor release-patch: - @$(XYZ) --increment $(@:release-%=%) - - -.PHONY: setup -setup: - npm install - - -.PHONY: test -test: - node -- test/index.js diff --git a/README.md b/README.md index 94c93432..31f84bc3 100644 --- a/README.md +++ b/README.md @@ -127,8 +127,8 @@ Each doctest has access to variables in its scope chain. ### Running the test suite ```console -$ make setup -$ make test +$ npm install +$ npm test ``` diff --git a/package.json b/package.json index 93831247..fb9d8751 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,13 @@ "sanctuary-type-classes": "8.1.x" }, "devDependencies": { - "eslint": "4.9.x", - "sanctuary-style": "1.1.x", - "xyz": "2.1.x" + "sanctuary-scripts": "1.1.x" + }, + "scripts": { + "doctest": "sanctuary-doctest", + "lint": "sanctuary-lint", + "release": "sanctuary-release", + "test": "npm run lint && sanctuary-test && npm run doctest" }, "files": [ "/bin/", diff --git a/scripts/doctest b/scripts/doctest new file mode 100755 index 00000000..e69de29b diff --git a/scripts/generate-readme b/scripts/generate-readme new file mode 100755 index 00000000..e69de29b diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..bfa0a0b0 --- /dev/null +++ b/scripts/test @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euf -o pipefail + +node -- test/index.js diff --git a/test/amd/results.js b/test/amd/results.js deleted file mode 100644 index ff560be2..00000000 --- a/test/amd/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'doctest in AMD module', - [true, '32', '32', 5] -]]; diff --git a/test/amd/results.json b/test/amd/results.json new file mode 100644 index 00000000..db600303 --- /dev/null +++ b/test/amd/results.json @@ -0,0 +1,11 @@ +[ + [ + "doctest in AMD module", + [ + true, + "32", + "32", + 5 + ] + ] +] diff --git a/test/bin/results.js b/test/bin/results.js deleted file mode 100644 index 7f40c310..00000000 --- a/test/bin/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'executable without file extension', - [true, '42', '42', 4] -]]; diff --git a/test/bin/results.json b/test/bin/results.json new file mode 100644 index 00000000..6bce4b2d --- /dev/null +++ b/test/bin/results.json @@ -0,0 +1,11 @@ +[ + [ + "executable without file extension", + [ + true, + "42", + "42", + 4 + ] + ] +] diff --git a/test/commonjs/exports/results.js b/test/commonjs/exports/results.js deleted file mode 100644 index 18d38f48..00000000 --- a/test/commonjs/exports/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'exports', - [true, '42', '42', 2] -]]; diff --git a/test/commonjs/exports/results.json b/test/commonjs/exports/results.json new file mode 100644 index 00000000..de1deb40 --- /dev/null +++ b/test/commonjs/exports/results.json @@ -0,0 +1,11 @@ +[ + [ + "exports", + [ + true, + "42", + "42", + 2 + ] + ] +] diff --git a/test/commonjs/module.exports/results.js b/test/commonjs/module.exports/results.js deleted file mode 100644 index 2137c852..00000000 --- a/test/commonjs/module.exports/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'module.exports', - [true, '42', '42', 2] -]]; diff --git a/test/commonjs/module.exports/results.json b/test/commonjs/module.exports/results.json new file mode 100644 index 00000000..289aea98 --- /dev/null +++ b/test/commonjs/module.exports/results.json @@ -0,0 +1,11 @@ +[ + [ + "module.exports", + [ + true, + "42", + "42", + 2 + ] + ] +] diff --git a/test/commonjs/require/results.js b/test/commonjs/require/results.js deleted file mode 100644 index eaf08ee3..00000000 --- a/test/commonjs/require/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'require another CommonJS module', - [true, '"function"', '"function"', 2] -]]; diff --git a/test/commonjs/require/results.json b/test/commonjs/require/results.json new file mode 100644 index 00000000..3326a6b9 --- /dev/null +++ b/test/commonjs/require/results.json @@ -0,0 +1,11 @@ +[ + [ + "require another CommonJS module", + [ + true, + "\"function\"", + "\"function\"", + 2 + ] + ] +] diff --git a/test/commonjs/strict/results.js b/test/commonjs/strict/results.js deleted file mode 100644 index a2eb1c91..00000000 --- a/test/commonjs/strict/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'preserves "use strict" directive', - [true, 'undefined', 'undefined', 4] -]]; diff --git a/test/commonjs/strict/results.json b/test/commonjs/strict/results.json new file mode 100644 index 00000000..691b0b93 --- /dev/null +++ b/test/commonjs/strict/results.json @@ -0,0 +1,11 @@ +[ + [ + "preserves 'use strict' directive", + [ + true, + "undefined", + "undefined", + 4 + ] + ] +] diff --git a/test/exceptions/results.js b/test/exceptions/results.js deleted file mode 100644 index e97fb8bf..00000000 --- a/test/exceptions/results.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = [[ - 'input evaluates to Error with expected message', - [true, 'Error: Invalid value', 'Error: Invalid value', 3] -], [ - 'input evaluates to Error without expected message', - [false, 'Error', 'Error: Invalid value', 6] -], [ - 'input evaluates to Error with unexpected message', - [false, 'Error: Invalid value', 'Error', 9] -], [ - 'input evaluates to Error with unexpected message', - [false, 'Error: Invalid value', 'Error: XXX', 12] -], [ - 'evaluating input does not throw expected exception', - [false, 'Error: Invalid value', '! Error: Invalid value', 15] -], [ - 'evaluating input throws unexpected exception', - [false, '! Error: Invalid value', 'Error: Invalid value', 18] -], [ - 'evaluating input throws exception as expected, of expected type', - [true, '! TypeError', '! TypeError', 21] -], [ - 'evaluating input throws exception as expected, of unexpected type', - [false, '! TypeError', '! Error', 24] -], [ - 'evaluating input throws exception as expected, with expected message', - [true, '! Error: Invalid value', '! Error: Invalid value', 27] -], [ - 'evaluating input throws exception as expected, with unexpected message', - [false, '! Error: Invalid value', '! Error: XXX', 30] -]]; diff --git a/test/exceptions/results.json b/test/exceptions/results.json new file mode 100644 index 00000000..1786936e --- /dev/null +++ b/test/exceptions/results.json @@ -0,0 +1,92 @@ +[ + [ + "input evaluates to Error with expected message", + [ + true, + "Error: Invalid value", + "Error: Invalid value", + 3 + ] + ], + [ + "input evaluates to Error without expected message", + [ + false, + "Error", + "Error: Invalid value", + 6 + ] + ], + [ + "input evaluates to Error with unexpected message", + [ + false, + "Error: Invalid value", + "Error", + 9 + ] + ], + [ + "input evaluates to Error with unexpected message", + [ + false, + "Error: Invalid value", + "Error: XXX", + 12 + ] + ], + [ + "evaluating input does not throw expected exception", + [ + false, + "Error: Invalid value", + "! Error: Invalid value", + 15 + ] + ], + [ + "evaluating input throws unexpected exception", + [ + false, + "! Error: Invalid value", + "Error: Invalid value", + 18 + ] + ], + [ + "evaluating input throws exception as expected, of expected type", + [ + true, + "! TypeError", + "! TypeError", + 21 + ] + ], + [ + "evaluating input throws exception as expected, of unexpected type", + [ + false, + "! TypeError", + "! Error", + 24 + ] + ], + [ + "evaluating input throws exception as expected, with expected message", + [ + true, + "! Error: Invalid value", + "! Error: Invalid value", + 27 + ] + ], + [ + "evaluating input throws exception as expected, with unexpected message", + [ + false, + "! Error: Invalid value", + "! Error: XXX", + 30 + ] + ] +] diff --git a/test/fantasy-land/results.js b/test/fantasy-land/results.js deleted file mode 100644 index a5f08a5f..00000000 --- a/test/fantasy-land/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'uses Z.equals for equality checks', - [true, 'Absolute(-1)', 'Absolute(1)', 2] -]]; diff --git a/test/fantasy-land/results.json b/test/fantasy-land/results.json new file mode 100644 index 00000000..f6c3efeb --- /dev/null +++ b/test/fantasy-land/results.json @@ -0,0 +1,11 @@ +[ + [ + "uses Z.equals for equality checks", + [ + true, + "Absolute(-1)", + "Absolute(1)", + 2 + ] + ] +] diff --git a/test/harmony/results.js b/test/harmony/results.js deleted file mode 100644 index 37bab7a4..00000000 --- a/test/harmony/results.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = [ - ['seq.next().value', [true, '1', '1', 13]], - ['seq.next().value', [true, '1', '1', 15]], - ['seq.next().value', [true, '2', '2', 17]], - ['seq.next().value', [true, '3', '3', 19]], - ['seq.next().value', [true, '5', '5', 21]], -]; diff --git a/test/harmony/results.json b/test/harmony/results.json new file mode 100644 index 00000000..f3f5d84d --- /dev/null +++ b/test/harmony/results.json @@ -0,0 +1,7 @@ +[ + ["seq.next().value", [true, "1", "1", 13]], + ["seq.next().value", [true, "1", "1", 15]], + ["seq.next().value", [true, "2", "2", 17]], + ["seq.next().value", [true, "3", "3", 19]], + ["seq.next().value", [true, "5", "5", 21]] +] diff --git a/test/index.js b/test/index.js index 8a0ae824..7504397b 100644 --- a/test/index.js +++ b/test/index.js @@ -43,7 +43,7 @@ function printResult(actual, expected, message) { function testModule(path, options) { var type = path.split('.').pop(); var actuals = doctest(path, options); - var expecteds = require(pathlib.resolve(path, '..', 'results')); + var expecteds = require(pathlib.resolve(path, '..', 'results.json')); for (var idx = 0; idx < expecteds.length; idx += 1) { printResult(actuals[idx], expecteds[idx][1], diff --git a/test/line-endings/results.js b/test/line-endings/results.js deleted file mode 100644 index 6593b507..00000000 --- a/test/line-endings/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'correct line number reported irrespective of line endings', - [true, '42', '42', 2] -]]; diff --git a/test/line-endings/results.json b/test/line-endings/results.json new file mode 100644 index 00000000..f76ad721 --- /dev/null +++ b/test/line-endings/results.json @@ -0,0 +1,11 @@ +[ + [ + "correct line number reported irrespective of line endings", + [ + true, + "42", + "42", + 2 + ] + ] +] diff --git a/test/shared/results.js b/test/shared/results.js deleted file mode 100644 index e29a4c15..00000000 --- a/test/shared/results.js +++ /dev/null @@ -1,98 +0,0 @@ -(function() { - - var results = [[ - 'global variable accessible in outer scope', - [true, '"global"', '"global"', 3] - ], [ - 'global variable accessible in inner scope', - [true, '"global"', '"global"', 10] - ], [ - 'local variable referenced, not shadowed global', - [true, '"shadowed"', '"shadowed"', 14] - ], [ - 'local variable accessible before declaration', - [true, '2', '2', 20] - ], [ - 'assignment is an expression', - [true, '3', '3', 25] - ], [ - 'variable declared in doctest remains accessible', - [true, '[1, 2, 3]', '[1, 2, 3]', 28] - ], [ - 'arithmetic error reported', - [false, '4', '5', 31] - ], [ - 'TypeError captured and reported', - [true, '! TypeError', '! TypeError', 35] - ], [ - 'TypeError expected but not reported', - [false, '0', '! TypeError', 38] - ], [ - 'function accessible before declaration', - [true, '12', '12', 42] - ], [ - 'NaN can be used as expected result', - [true, 'NaN', 'NaN', 45] - ], [ - 'function accessible after declaration', - [true, '4', '4', 53] - ], [ - 'multiline input', - [true, '[1, 2, 3, 4, 5, 6, 7, 8, 9]', '[1, 2, 3, 4, 5, 6, 7, 8, 9]', 65] - ], [ - 'multiline assignment', - [true, '"input may span many lines"', '"input may span many lines"', 71] - ], [ - 'spaces following "//" and ">" are optional', - [true, '"no spaces"', '"no spaces"', 75] - ], [ - 'indented doctest', - [true, '"Docco-compatible whitespace"', '"Docco-compatible whitespace"', 78] - ], [ - '">" in doctest', - [true, 'true', 'true', 81] - ], [ - 'comment on input line', - [true, '"foobar"', '"foobar"', 85] - ], [ - 'comment on output line', - [true, '25', '25', 88] - ], [ - 'variable in creation context is not accessible', - [true, '"undefined"', '"undefined"', 92] - ], [ - '"." should not follow leading "." in multiline expressions', - [false, '5', '9.5', 97] - ], [ - 'wrapped lines may begin with more than one "."', - [true, '1234.5', '1234.5', 105] - ], [ - 'multiline comment', - [true, '23', '23', 110] - ], [ - 'multiline comment with wrapped input', - [true, '"FOO BAR"', '"FOO BAR"', 119] - ], [ - 'multiline comment with leading asterisks', - [true, '25', '25', 125] - ], [ - 'multiline comment with leading asterisks', - [true, '25', '25', 127] - ], [ - 'multiline comment with leading asterisks and wrapped input', - [true, '55', '55', 135] - ], [ - 'multiline output', - [true, '["foo", "bar", "baz"]', '["foo", "bar", "baz"]', 140] - ], [ - 'multiline input with multiline output', - [true, '["FOO", "BAR", "BAZ"]', '["FOO", "BAR", "BAZ"]', 149] - ]]; - - if (typeof window === 'undefined') { - module.exports = results; - } else { - window.results = results; - } - -}()); diff --git a/test/shared/results.json b/test/shared/results.json new file mode 100644 index 00000000..663b520d --- /dev/null +++ b/test/shared/results.json @@ -0,0 +1,263 @@ +[ + [ + "global variable accessible in outer scope", + [ + true, + "\"global\"", + "\"global\"", + 3 + ] + ], + [ + "global variable accessible in inner scope", + [ + true, + "\"global\"", + "\"global\"", + 10 + ] + ], + [ + "local variable referenced, not shadowed global", + [ + true, + "\"shadowed\"", + "\"shadowed\"", + 14 + ] + ], + [ + "local variable accessible before declaration", + [ + true, + "2", + "2", + 20 + ] + ], + [ + "assignment is an expression", + [ + true, + "3", + "3", + 25 + ] + ], + [ + "variable declared in doctest remains accessible", + [ + true, + "[1, 2, 3]", + "[1, 2, 3]", + 28 + ] + ], + [ + "arithmetic error reported", + [ + false, + "4", + "5", + 31 + ] + ], + [ + "TypeError captured and reported", + [ + true, + "! TypeError", + "! TypeError", + 35 + ] + ], + [ + "TypeError expected but not reported", + [ + false, + "0", + "! TypeError", + 38 + ] + ], + [ + "function accessible before declaration", + [ + true, + "12", + "12", + 42 + ] + ], + [ + "NaN can be used as expected result", + [ + true, + "NaN", + "NaN", + 45 + ] + ], + [ + "function accessible after declaration", + [ + true, + "4", + "4", + 53 + ] + ], + [ + "multiline input", + [ + true, + "[1, 2, 3, 4, 5, 6, 7, 8, 9]", + "[1, 2, 3, 4, 5, 6, 7, 8, 9]", + 65 + ] + ], + [ + "multiline assignment", + [ + true, + "\"input may span many lines\"", + "\"input may span many lines\"", + 71 + ] + ], + [ + "spaces following '//' and '>' are optional", + [ + true, + "\"no spaces\"", + "\"no spaces\"", + 75 + ] + ], + [ + "indented doctest", + [ + true, + "\"Docco-compatible whitespace\"", + "\"Docco-compatible whitespace\"", + 78 + ] + ], + [ + "'>' in doctest", + [ + true, + "true", + "true", + 81 + ] + ], + [ + "comment on input line", + [ + true, + "\"foobar\"", + "\"foobar\"", + 85 + ] + ], + [ + "comment on output line", + [ + true, + "25", + "25", + 88 + ] + ], + [ + "variable in creation context is not accessible", + [ + true, + "\"undefined\"", + "\"undefined\"", + 92 + ] + ], + [ + "'.' should not follow leading '.' in multiline expressions", + [ + false, + "5", + "9.5", + 97 + ] + ], + [ + "wrapped lines may begin with more than one '.'", + [ + true, + "1234.5", + "1234.5", + 105 + ] + ], + [ + "multiline comment", + [ + true, + "23", + "23", + 110 + ] + ], + [ + "multiline comment with wrapped input", + [ + true, + "\"FOO BAR\"", + "\"FOO BAR\"", + 119 + ] + ], + [ + "multiline comment with leading asterisks", + [ + true, + "25", + "25", + 125 + ] + ], + [ + "multiline comment with leading asterisks", + [ + true, + "25", + "25", + 127 + ] + ], + [ + "multiline comment with leading asterisks and wrapped input", + [ + true, + "55", + "55", + 135 + ] + ], + [ + "multiline output", + [ + true, + "[\"foo\", \"bar\", \"baz\"]", + "[\"foo\", \"bar\", \"baz\"]", + 140 + ] + ], + [ + "multiline input with multiline output", + [ + true, + "[\"FOO\", \"BAR\", \"BAZ\"]", + "[\"FOO\", \"BAR\", \"BAZ\"]", + 149 + ] + ] +] diff --git a/test/statements/results.js b/test/statements/results.js deleted file mode 100644 index b27af4b9..00000000 --- a/test/statements/results.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = [[ - 'var', - [true, '8', '8', 6] -], [ - 'let', - [true, '1', '1', 11] -], [ - 'function declaration', - [true, '55', '55', 16] -]]; diff --git a/test/statements/results.json b/test/statements/results.json new file mode 100644 index 00000000..2751ba02 --- /dev/null +++ b/test/statements/results.json @@ -0,0 +1,29 @@ +[ + [ + "var", + [ + true, + "8", + "8", + 6 + ] + ], + [ + "let", + [ + true, + "1", + "1", + 11 + ] + ], + [ + "function declaration", + [ + true, + "55", + "55", + 16 + ] + ] +] diff --git a/test/transcribe/results.js b/test/transcribe/results.js deleted file mode 100644 index 51de398a..00000000 --- a/test/transcribe/results.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [[ - 'accepts Transcribe-style prefix', - [true, '[1, 2, 3]', '[1, 2, 3]', 8] -]]; diff --git a/test/transcribe/results.json b/test/transcribe/results.json new file mode 100644 index 00000000..05111371 --- /dev/null +++ b/test/transcribe/results.json @@ -0,0 +1,11 @@ +[ + [ + "accepts Transcribe-style prefix", + [ + true, + "[1, 2, 3]", + "[1, 2, 3]", + 8 + ] + ] +]