Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tadashi-aikawa committed Aug 25, 2024
1 parent a4c4e79 commit 8f163f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tokenizer/tokenizers/DefaultTokenizer.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test } from "@jest/globals";
import { DefaultTokenizer } from "./DefaultTokenizer";
import type { FactoryArgs } from "../tokenizer";
import { DefaultTokenizer } from "./DefaultTokenizer";

describe.each<{
constructorArgs: FactoryArgs;
Expand All @@ -21,8 +21,11 @@ describe.each<{
${{}} | ${"**bold** *italic*"} | ${["bold", "italic"]}
${{}} | ${"__a _b __c__ d_ e__"} | ${["a", "b", "c", "d", "e"]}
${{ treatUnderscoreAsPartOfWord: true }} | ${"__a _b __c__ d_ e__"} | ${["__a", "_b", "__c__", "d_", "e__"]}
${{}} | ${"--a -b --c-- d- e--"} | ${["--a", "-b", "--c--", "d-", "e--"]}
${{ treatUnderscoreAsPartOfWord: true }} | ${"--a _b -_c_- d- e__"} | ${["--a", "_b", "-_c_-", "d-", "e__"]}
${{}} | ${"let hoge_huga = 1"} | ${["let", "hoge", "huga", "1"]}
${{ treatUnderscoreAsPartOfWord: true }} | ${"let hoge_huga = 1"} | ${["let", "hoge_huga", "1"]}
${{}} | ${"let hoge-huga = 1"} | ${["let", "hoge-huga", "1"]}
${{}} | ${'"aaa" "bbb"'} | ${["aaa", "bbb"]}
${{}} | ${"'aaa' 'bbb'"} | ${["aaa", "bbb"]}
${{}} | ${"„aaa“ „bbb“"} | ${["aaa", "bbb"]}
Expand Down

0 comments on commit 8f163f0

Please sign in to comment.