Skip to content

Commit

Permalink
Improve tests for generator.go
Browse files Browse the repository at this point in the history
  • Loading branch information
greymd committed Jun 5, 2021
1 parent fc14a11 commit c382361
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ package generator

import "testing"

func TestStart1(t *testing.T) {
config := Config{}
actual, err := Start(config)
t.Log(actual)
if err != nil {
t.Errorf("handler returned unexpected body: got %v", err)
}
}

func TestStart2(t *testing.T) {
config := Config{
PunctuationLevel: 4,
}
_, err := Start(config)
t.Log(err)
if err == nil {
t.Errorf("handler returned unexpected body: got nil")
}
}

func TestKatakanaKatsuyou1(t *testing.T) {
expected := "なんちゃッテ"
actual := katakanaKatsuyou("なんちゃって", 2)
Expand Down Expand Up @@ -68,4 +88,4 @@ func BenchmarkPunctuation(b *testing.B) {
for i:=0; i < b.N; i++ {
insertPunctuations("どうしちゃったのかな", PunctuationConfig{[]string{"助動詞", "助詞"}, 100})
}
}
}

0 comments on commit c382361

Please sign in to comment.