Skip to content

Commit

Permalink
Fix : jamoOption_test.go *opts changed to opt
Browse files Browse the repository at this point in the history
Signed-off-by: ymw0407 <yunminwo1211@gmail.com>
  • Loading branch information
ymw0407 committed Apr 7, 2024
1 parent 7c6485d commit fa1aa5a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/options/jamoOption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,71 +28,71 @@ func TestJamoOption(t *testing.T) {
t.Run("꿳테스트 with jamo options(all false)", func(t *testing.T) {
expected := "ㄲㅞㄳㅌㅔㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(false).SetTenseConsonants(false).SetDiphthong(false)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})

t.Run("꿳테스트 with jamo options(complex consonants)", func(t *testing.T) {
expected := "ㄲㅞㄱㅅㅌㅔㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(true).SetTenseConsonants(false).SetDiphthong(false)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})

t.Run("꿳테스트 with jamo options(tense consonants)", func(t *testing.T) {
expected := "ㄱㄱㅞㄳㅌㅔㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(false).SetTenseConsonants(true).SetDiphthong(false)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})

t.Run("꿳테스트 with jamo options(diphthong)", func(t *testing.T) {
expected := "ㄲㅜㅓㅣㄳㅌㅓㅣㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(false).SetTenseConsonants(false).SetDiphthong(true)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})

t.Run("꿳테스트 with jamo options(complex consonants, tense consonants)", func(t *testing.T) {
expected := "ㄱㄱㅞㄱㅅㅌㅔㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(true).SetTenseConsonants(true).SetDiphthong(false)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})

t.Run("꿳테스트 with jamo options(complex consonants, tense consonants)", func(t *testing.T) {
expected := "ㄱㄱㅞㄱㅅㅌㅔㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(true).SetTenseConsonants(true).SetDiphthong(false)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})

t.Run("꿳테스트 with jamo options(complex consonants, diphthong)", func(t *testing.T) {
expected := "ㄲㅜㅓㅣㄱㅅㅌㅓㅣㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(true).SetTenseConsonants(false).SetDiphthong(true)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})

t.Run("꿳테스트 with jamo options(tense consonants, diphthong)", func(t *testing.T) {
expected := "ㄱㄱㅜㅓㅣㄳㅌㅓㅣㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(false).SetTenseConsonants(true).SetDiphthong(true)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})

t.Run("꿳테스트 with jamo options(complex consonants, tense consonants, diphthong)", func(t *testing.T) {
expected := "ㄱㄱㅜㅓㅣㄱㅅㅌㅓㅣㅅㅡㅌㅡ"
opts := options.Jamo().SetComplexConsonants(true).SetTenseConsonants(true).SetDiphthong(true)
res := jamo.DecomposeHangeul("꿳테스트", *opts)
res := jamo.DecomposeHangeul("꿳테스트", opts)

assert.Equal(t, expected, res, res+" : `"+expected+"` is expected!")
})
Expand Down

0 comments on commit fa1aa5a

Please sign in to comment.