Browse Source

Added TestInvalidString

Piotr Czajkowski 3 years ago
parent
commit
88deb1abe9
1 changed files with 14 additions and 0 deletions
  1. 14 0
      encodedText_test.go

+ 14 - 0
encodedText_test.go

@@ -18,3 +18,17 @@ This long looong sentence some test with words`
 		t.Errorf("There should be error as prefix is invalid!")
 	}
 }
+
+func TestInvalidString(t *testing.T) {
+	input := `
+---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!")
+	}
+
+}