Skip to content

Commit

Permalink
Use example files as tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gregoire-mullvad committed Oct 2, 2024
1 parent ab62ece commit bbce868
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
33 changes: 33 additions & 0 deletions tests/examples.trycmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Run test on example files

# Go

```
$ unicop example-files/examples.go
IO error for operation on example-files/examples.go: No such file or directory (os error 2)

```


# Typescript

```
$ unicop example-files/examples.ts
× found disallowed character LATIN LETTER RETROFLEX CLICK in identifier
╭─[example-files/examples.ts:11:16]
10 │ // Homoglyph
11 │ if (environmentǃ=ENV_PROD) {}
· ┬
· ╰── LATIN LETTER RETROFLEX CLICK
12 │
╰────
× found disallowed character HANGUL JUNGSEONG FILLER in
│ shorthand_property_identifier_pattern
╭─[example-files/examples.ts:14:17]
13 │ // Invisible
14 │ const { timeout,ᅠ} = req.query;
· ┬
· ╰── HANGUL JUNGSEONG FILLER
╰────

```
4 changes: 3 additions & 1 deletion tests/trycmd.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#[test]
fn trycmd() {
trycmd::TestCases::new().case("README.md");
trycmd::TestCases::new()
.case("README.md")
.case("tests/examples.trycmd");
}

0 comments on commit bbce868

Please sign in to comment.