Skip to content

Commit

Permalink
ran prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewnitschke-wk committed Sep 15, 2024
1 parent b1f45f7 commit ff37e14
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions docs/test_file_format.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@

# `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

### 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() {
// ^ ...
// ^^^^^^^^^^^^ ...
// <- ...
// ^ ...
// ^^^^^^^^^^^^ ...
// <- ...
}
```

Expand All @@ -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.
}
```
```

0 comments on commit ff37e14

Please sign in to comment.