summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-05-10 07:53:23 -0300
committerEuAndreh <eu@euandre.org>2025-05-10 07:53:23 -0300
commit7b0dbf8da51cbbdd8c3ecd564fe32d1eae15b2c1 (patch)
treecef3ff613d5c60709f808c50291e62c02516f1d6 /tests
parentsrc/gobang.go: Add ExitIf() (diff)
downloadgobang-7b0dbf8da51cbbdd8c3ecd564fe32d1eae15b2c1.tar.gz
gobang-7b0dbf8da51cbbdd8c3ecd564fe32d1eae15b2c1.tar.xz
src/gobang.go: Add Heredoc()
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()