diff --git a/crates/typos-cli/tests/cmd/assumed-dir-failure.toml b/crates/typos-cli/tests/cmd/assumed-dir-failure.toml index a04fffd..0908fa4 100644 --- a/crates/typos-cli/tests/cmd/assumed-dir-failure.toml +++ b/crates/typos-cli/tests/cmd/assumed-dir-failure.toml @@ -1,2 +1,4 @@ bin.name = "typos" status.code = 2 +stdin = "" +stderr = "" diff --git a/crates/typos-cli/tests/cmd/double-escaped.stdin b/crates/typos-cli/tests/cmd/double-escaped.stdin deleted file mode 100644 index 7409124..0000000 --- a/crates/typos-cli/tests/cmd/double-escaped.stdin +++ /dev/null @@ -1,2 +0,0 @@ -\n\n -Destory diff --git a/crates/typos-cli/tests/cmd/double-escaped.stdout b/crates/typos-cli/tests/cmd/double-escaped.stdout deleted file mode 100644 index 35ace03..0000000 --- a/crates/typos-cli/tests/cmd/double-escaped.stdout +++ /dev/null @@ -1,2 +0,0 @@ -\n\n -Destroy diff --git a/crates/typos-cli/tests/cmd/double-escaped.toml b/crates/typos-cli/tests/cmd/double-escaped.toml index 6c0caf9..7994f3c 100644 --- a/crates/typos-cli/tests/cmd/double-escaped.toml +++ b/crates/typos-cli/tests/cmd/double-escaped.toml @@ -1,3 +1,12 @@ bin.name = "typos" args = "--write-changes -" status.code = 0 +stdin = ''' +\n\n +Destory +''' +stdout = """ +/n/n +Destroy +""" +stderr = "" diff --git a/crates/typos-cli/tests/cmd/file-failure.toml b/crates/typos-cli/tests/cmd/file-failure.toml index 0593893..1670260 100644 --- a/crates/typos-cli/tests/cmd/file-failure.toml +++ b/crates/typos-cli/tests/cmd/file-failure.toml @@ -1,3 +1,43 @@ bin.name = "typos" args = "../../README.md" status.code = 2 +stdin = "" +stdout = """ +error: `Supress` should be `Suppress` + --> ../../README.md:78:19 + | +78 | \"AttributeID.*Supress.*\", + | ^^^^^^^ + | +error: `Supress` should be `Suppress` + --> ../../README.md:83:12 + | +83 | AttributeIDSupressMenu = \"AttributeIDSupressMenu\" + | ^^^^^^^ + | +error: `Supress` should be `Suppress` + --> ../../README.md:83:38 + | +83 | AttributeIDSupressMenu = \"AttributeIDSupressMenu\" + | ^^^^^^^ + | +error: `Teh` should be `The` + --> ../../README.md:86:30 + | +86 | # Don't correct the surname \"Teh\" + | ^^^ + | +error: `teh` should be `the` + --> ../../README.md:87:1 + | +87 | teh = \"teh\" + | ^^^ + | +error: `teh` should be `the` + --> ../../README.md:87:8 + | +87 | teh = \"teh\" + | ^^^ + | +""" +stderr = "" diff --git a/crates/typos-cli/tests/cmd/relative-dir-failure.toml b/crates/typos-cli/tests/cmd/relative-dir-failure.toml index d742035..1534d1a 100644 --- a/crates/typos-cli/tests/cmd/relative-dir-failure.toml +++ b/crates/typos-cli/tests/cmd/relative-dir-failure.toml @@ -1,3 +1,5 @@ bin.name = "typos" args = "." status.code = 2 +stdin = "" +stderr = "" diff --git a/crates/typos-cli/tests/cmd/stdin-correct.stdin b/crates/typos-cli/tests/cmd/stdin-correct.stdin deleted file mode 100644 index 78a4360..0000000 --- a/crates/typos-cli/tests/cmd/stdin-correct.stdin +++ /dev/null @@ -1 +0,0 @@ -Apropriate world diff --git a/crates/typos-cli/tests/cmd/stdin-correct.stdout b/crates/typos-cli/tests/cmd/stdin-correct.stdout deleted file mode 100644 index 8d183c3..0000000 --- a/crates/typos-cli/tests/cmd/stdin-correct.stdout +++ /dev/null @@ -1 +0,0 @@ -Appropriate world diff --git a/crates/typos-cli/tests/cmd/stdin-correct.toml b/crates/typos-cli/tests/cmd/stdin-correct.toml index fd62546..81b3cb1 100644 --- a/crates/typos-cli/tests/cmd/stdin-correct.toml +++ b/crates/typos-cli/tests/cmd/stdin-correct.toml @@ -1,2 +1,9 @@ bin.name = "typos" args = "--write-changes -" +stdin = ''' +Apropriate world +''' +stdout = """ +Appropriate world +""" +stderr = "" diff --git a/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.stdin b/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.stdin deleted file mode 100644 index 989b316..0000000 --- a/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.stdin +++ /dev/null @@ -1,34 +0,0 @@ ---- -Korean character (NFC) -Grapheme clusters: 1, codepoints: 1, UnicodeWidthStr::width() == 2 - -한 Apropriate world - ^^^^^^^^^^ highlight here - ---- -Korean character (NFD). -Grapheme clusters: 1, codepoints: 3, UnicodeWidthStr::width() == 2 - -한 Apropriate world - ^^^^^^^^^^ highlight here - ---- -Eye in Speech Bubble Emoji (U+1F441 U+FE0F U+200D U+1F5E8 U+FE0F, Recommended Emoji ZWJ Sequences, v2.0) -Grapheme clusters: 1, codepoints: 5, UnicodeWidthStr::width() == 2 (Read NOTE: https://github.com/unicode-rs/unicode-width) - -👁️‍🗨️ Apropriate world - ^^^^^^^^^^ highlight here - ---- -Face with spiral eyes (U+1F635 U+200D U+1F4AB, Recommended Emoji ZWJ Sequence, v13.1) -Grapheme clusters: 1, codepoints: 3, UnicodeWidthStr::width() == 4 (Read NOTE: https://github.com/unicode-rs/unicode-width) - -😵‍💫 Apropriate world - ^^^^^^^^^^ highlight here - ---- -Horizontal tab (\t, U+09) -Grapheme clusters: 1, codepoints: 1, UnicodeWidthStr::width() == 0 - - Apropriate world - ^^^^^^^^^^ highlight here \ No newline at end of file diff --git a/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.stdout b/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.stdout deleted file mode 100644 index 64176a2..0000000 --- a/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.stdout +++ /dev/null @@ -1,30 +0,0 @@ -error: `Apropriate` should be `Appropriate` - --> -:5:3 - | -5 | 한 Apropriate world - | ^^^^^^^^^^ - | -error: `Apropriate` should be `Appropriate` - --> -:12:3 - | -12 | 한 Apropriate world - | ^^^^^^^^^^ - | -error: `Apropriate` should be `Appropriate` - --> -:19:3 - | -19 | 👁️‍🗨️ Apropriate world - | ^^^^^^^^^^ - | -error: `Apropriate` should be `Appropriate` - --> -:26:3 - | -26 | 😵‍💫 Apropriate world - | ^^^^^^^^^^ - | -error: `Apropriate` should be `Appropriate` - --> -:33:2 - | -33 | Apropriate world - | ^^^^^^^^^^ - | diff --git a/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.toml b/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.toml index 18f517f..34d656d 100644 --- a/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.toml +++ b/crates/typos-cli/tests/cmd/stdin-failure-multiwidth.toml @@ -1,3 +1,72 @@ bin.name = "typos" args = "-" -status.code = 2 \ No newline at end of file +status.code = 2 +stdin = ''' +--- +Korean character (NFC) +Grapheme clusters: 1, codepoints: 1, UnicodeWidthStr::width() == 2 + +한 Apropriate world + ^^^^^^^^^^ highlight here + +--- +Korean character (NFD). +Grapheme clusters: 1, codepoints: 3, UnicodeWidthStr::width() == 2 + +한 Apropriate world + ^^^^^^^^^^ highlight here + +--- +Eye in Speech Bubble Emoji (U+1F441 U+FE0F U+200D U+1F5E8 U+FE0F, Recommended Emoji ZWJ Sequences, v2.0) +Grapheme clusters: 1, codepoints: 5, UnicodeWidthStr::width() == 2 (Read NOTE: https://github.com/unicode-rs/unicode-width) + +👁️‍🗨️ Apropriate world + ^^^^^^^^^^ highlight here + +--- +Face with spiral eyes (U+1F635 U+200D U+1F4AB, Recommended Emoji ZWJ Sequence, v13.1) +Grapheme clusters: 1, codepoints: 3, UnicodeWidthStr::width() == 4 (Read NOTE: https://github.com/unicode-rs/unicode-width) + +😵‍💫 Apropriate world + ^^^^^^^^^^ highlight here + +--- +Horizontal tab (\t, U+09) +Grapheme clusters: 1, codepoints: 1, UnicodeWidthStr::width() == 0 + + Apropriate world + ^^^^^^^^^^ highlight here +''' +stdout = """ +error: `Apropriate` should be `Appropriate` + --> -:5:3 + | +5 | 한 Apropriate world + | ^^^^^^^^^^ + | +error: `Apropriate` should be `Appropriate` + --> -:12:3 + | +12 | 한 Apropriate world + | ^^^^^^^^^^ + | +error: `Apropriate` should be `Appropriate` + --> -:19:3 + | +19 | 👁️‍🗨️ Apropriate world + | ^^^^^^^^^^ + | +error: `Apropriate` should be `Appropriate` + --> -:26:3 + | +26 | 😵‍💫 Apropriate world + | ^^^^^^^^^^ + | +error: `Apropriate` should be `Appropriate` + --> -:33:2 + | +33 | Apropriate world + | ^^^^^^^^^^ + | +""" +stderr = "" diff --git a/crates/typos-cli/tests/cmd/stdin-failure.stdin b/crates/typos-cli/tests/cmd/stdin-failure.stdin deleted file mode 100644 index 78a4360..0000000 --- a/crates/typos-cli/tests/cmd/stdin-failure.stdin +++ /dev/null @@ -1 +0,0 @@ -Apropriate world diff --git a/crates/typos-cli/tests/cmd/stdin-failure.toml b/crates/typos-cli/tests/cmd/stdin-failure.toml index 74181fa..9428a78 100644 --- a/crates/typos-cli/tests/cmd/stdin-failure.toml +++ b/crates/typos-cli/tests/cmd/stdin-failure.toml @@ -1,3 +1,15 @@ bin.name = "typos" args = "-" status.code = 2 +stdin = ''' +Apropriate world +''' +stdout = """ +error: `Apropriate` should be `Appropriate` + --> -:1:1 + | +1 | Apropriate world + | ^^^^^^^^^^ + | +""" +stderr = "" diff --git a/crates/typos-cli/tests/cmd/stdin-success.stdin b/crates/typos-cli/tests/cmd/stdin-success.stdin deleted file mode 100644 index 802992c..0000000 --- a/crates/typos-cli/tests/cmd/stdin-success.stdin +++ /dev/null @@ -1 +0,0 @@ -Hello world diff --git a/crates/typos-cli/tests/cmd/stdin-success.toml b/crates/typos-cli/tests/cmd/stdin-success.toml index 15dd0dd..7c934bd 100644 --- a/crates/typos-cli/tests/cmd/stdin-success.toml +++ b/crates/typos-cli/tests/cmd/stdin-success.toml @@ -1,2 +1,7 @@ bin.name = "typos" args = "-" +stdin = ''' +Hello world +''' +stdout = "" +stderr = ""