diff options
| author | Will Hawkins <[email protected]> | 2024-01-03 19:11:10 -0500 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2024-01-04 19:17:06 -0500 |
| commit | 218f2e6d235c4e947a04a39e4e09acde7675de6a (patch) | |
| tree | 4642b7deed792e8345ccef86d549c8748a9e0ce8 /utilities/utilities_test.go | |
| parent | f3990f950277c2f61e0e1811b4b8a81fc0219da4 (diff) | |
[Feature] Reformat test result output.
Diffstat (limited to 'utilities/utilities_test.go')
| -rw-r--r-- | utilities/utilities_test.go | 20 |
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) + } +} |
