summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/gobang.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/gobang.go b/tests/gobang.go
index fe47086..7391475 100644
--- a/tests/gobang.go
+++ b/tests/gobang.go
@@ -15,6 +15,38 @@ import (
+func test_Heredoc() {
+ TestStart("Heredoc()")
+
+ Testing("only add newline on empty string", func() {
+ TAssertEqual(Heredoc(""), "\n")
+ })
+
+ Testing("remove leading newline", func() {
+ given := Heredoc(`
+ Start
+ and
+ end
+`)
+ expected := ` Start
+ and
+ end
+`
+
+ TAssertEqual(given, expected)
+ })
+
+ Testing("removes ALL tabs", func() {
+ given := Heredoc(`
+ Tab here> <within the line
+ `)
+
+ expected := "Tab here><within the line\n"
+
+ TAssertEqual(given, expected)
+ })
+}
+
func test_SetOf() {
TestStart("SetOf()")
@@ -1556,6 +1588,7 @@ func test_setHostname() {
func MainTest() {
Init()
+ test_Heredoc()
test_SetOf()
test_Contains()
test_MapIndexed()