summaryrefslogtreecommitdiff
path: root/typeconv_test.go
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2017-05-12 09:11:52 -0400
committerDave Henderson <dhenderson@gmail.com>2017-05-12 09:16:01 -0400
commit617e2e9df2aed6c17a4eee7b3b963a2388a1ec11 (patch)
treeac470906d012520bb9f1e574a44521c0447ed1cf /typeconv_test.go
parentebb865e7d178ff5d09a6bd748b86b03c6ee59b5f (diff)
Adding new indent function
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'typeconv_test.go')
-rw-r--r--typeconv_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/typeconv_test.go b/typeconv_test.go
index ae2424ce..85620b7c 100644
--- a/typeconv_test.go
+++ b/typeconv_test.go
@@ -169,3 +169,16 @@ func TestHas(t *testing.T) {
assert.False(t, ty.Has(in, "bar"))
assert.True(t, ty.Has(in["baz"], "qux"))
}
+
+func TestIndent(t *testing.T) {
+ ty := new(TypeConv)
+ actual := "hello\nworld\n!"
+ expected := " hello\n world\n !"
+ assert.Equal(t, expected, ty.indent(" ", actual))
+
+ assert.Equal(t, "\n", ty.indent(" ", "\n"))
+
+ assert.Equal(t, " foo\n", ty.indent(" ", "foo\n"))
+
+ assert.Equal(t, " foo", ty.indent(" ", "foo"))
+}