diff --git a/docs/test_file_format.md b/docs/test_file_format.md index a98dfd04..4e98b456 100644 --- a/docs/test_file_format.md +++ b/docs/test_file_format.md @@ -1,9 +1,7 @@ - # `scip test` file format The `scip test` command validates whether a provided SCIP index, matches manually specified fields in a syntax file. These files are loosely based on [Sublime Text's](https://www.sublimetext.com/docs/syntax.html#testing) syntax highlighting tests. - ## File Format Test cases are made up of a range, type, and data attribute @@ -11,15 +9,16 @@ Test cases are made up of a range, type, and data attribute ### Ranges Three range selection comment formats are supported: + - `// ^^^`: enforces the length of the occurrence. Will fail if the range at this location does not equal 3 characters - `// ^`: ignore length, `^` can occur at any point to any character in the occurrence - `// <-`: ignore length, and treat the character above the first comment character as the start of the occurrence, similar to Sublime Text ```js function someFunction() { - // ^ ... - // ^^^^^^^^^^^^ ... - // <- ... + // ^ ... + // ^^^^^^^^^^^^ ... + // <- ... } ``` @@ -34,19 +33,20 @@ There are four possible types test cases. The chosen test case is determined by ```js function someFunction() { - // ^ definition scip-typescript npm test_package 1.0.0 lib/`test.js`/someFunction(). + // ^ definition scip-typescript npm test_package 1.0.0 lib/`test.js`/someFunction(). - someOtherFunction(); - // <- reference scip-typescript npm test_package 1.0.0 lib/`test.js`/someOtherFunction(). + someOtherFunction() + // <- reference scip-typescript npm test_package 1.0.0 lib/`test.js`/someOtherFunction(). } ``` Some test types can provide additional data, you can use a `>` character on a new line + ```js function someFn() { - let someVar = ""; - // ^ diagnostic Warning - // > someVar is unused. - // > remove it or use it. + let someVar = '' + // ^ diagnostic Warning + // > someVar is unused. + // > remove it or use it. } -``` \ No newline at end of file +```