|
@@ -20,15 +20,29 @@ This long looong sentence some test with words`
|
|
|
}
|
|
|
|
|
|
func TestInvalidString(t *testing.T) {
|
|
|
- input := `
|
|
|
+ testCases := []string{
|
|
|
+ `
|
|
|
---weird---
|
|
|
Tihs is a lnog lnooog tset setcnnee,
|
|
|
wtih smoe big (biiiiig) wdros!
|
|
|
----weird---`
|
|
|
- test := EncodedText{}
|
|
|
- err := test.FromString(input)
|
|
|
- if err == nil {
|
|
|
- t.Errorf("There should be error as string is invalid!")
|
|
|
+---weird---`,
|
|
|
+ `
|
|
|
+---weird---
|
|
|
+---weird---
|
|
|
+This long looong sentence some test with words`,
|
|
|
+ `
|
|
|
+---weird---
|
|
|
+Tihs is a lnog lnooog tset setcnnee,
|
|
|
+wtih smoe big (biiiiig) wdros!
|
|
|
+---weird---
|
|
|
+`,
|
|
|
}
|
|
|
|
|
|
+ for _, input := range testCases {
|
|
|
+ test := EncodedText{}
|
|
|
+ err := test.FromString(input)
|
|
|
+ if err == nil {
|
|
|
+ t.Errorf("There should be error as string is invalid!")
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|