0.1.0 • Published 5 years ago

flextag-test v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

flextag-test

NPM version

Test suite for flextag tools

Cross Platform

Code for managing the test suite is in JavaScript, but the actual tests are all converted to JSON for easy access from other languages.

For example, syntax.json starts:

[
  {
    "feature": "intro",
    "input": "Hello, World!",
    "output": "Hello, World",
    "comment": "Statement-ending punctuation is removed. A bit sad for this example."
  },
  {
    "feature": "intro",
    "input": "Hi. Bye.",
    "output": [
      "Hi",
      "Bye"
    ],
    "comment": "When that punctuation ends a statement, addition text is considered a new statement."
  }
...

Via NPM

With node/npm, you can just

const { syntax } = require('flextag-test')
console.log(syntax[0])
/* =>
 feature: 'intro',
  input: 'Hello, World!',
  output: 'Hello, World',
  comment:
   'Statement-ending punctuation is removed. A bit sad for this example.' }
*/

Types of tests

Right now we have:

  • Syntax tests with tc.input and tc.output, where output is a representation of the syntax tree.