summaryrefslogtreecommitdiff
path: root/utilities/utilities_test.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2024-01-03 19:11:10 -0500
committerWill Hawkins <[email protected]>2024-01-04 19:17:06 -0500
commit218f2e6d235c4e947a04a39e4e09acde7675de6a (patch)
tree4642b7deed792e8345ccef86d549c8748a9e0ce8 /utilities/utilities_test.go
parentf3990f950277c2f61e0e1811b4b8a81fc0219da4 (diff)
[Feature] Reformat test result output.
Diffstat (limited to 'utilities/utilities_test.go')
-rw-r--r--utilities/utilities_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/utilities/utilities_test.go b/utilities/utilities_test.go
index 7f3d83a..8f43c6d 100644
--- a/utilities/utilities_test.go
+++ b/utilities/utilities_test.go
@@ -188,3 +188,23 @@ func TestTrimmedMean(t *testing.T) {
t.Fatalf("The trimmed mean result %v does not match the expected value %v", result, expected)
}
}
+
+func TestIndentStringOneNewline(t *testing.T) {
+ output := "This is my output\n"
+
+ indendentedOutput := IndentOutput(output, 3, "--")
+
+ if indendentedOutput != "------This is my output\n" {
+ t.Fatalf("I expected the indented output to be ####%v#### but got ####%v####!", output, indendentedOutput)
+ }
+}
+
+func TestIndentStringMultipleNewlines(t *testing.T) {
+ output := "This is my output\n\n"
+
+ indendentedOutput := IndentOutput(output, 3, "--")
+
+ if indendentedOutput != "------This is my output\n------\n" {
+ t.Fatalf("I expected the indented output to be ####%v#### but got ####%v####!", output, indendentedOutput)
+ }
+}