Procházet zdrojové kódy

Added TestInvalidString

Piotr Czajkowski před 4 roky
rodič
revize
88deb1abe9
1 změnil soubory, kde provedl 14 přidání a 0 odebrání
  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!")
+	}
+
+}