Skip to content

Commit e549cfa

Browse files
committed
Added more tests
1 parent 0c28af8 commit e549cfa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

stringbuilder_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,16 @@ func TestRemoveWhenEndIndexOutOfBounds(t *testing.T) {
107107
t.Error("Should throw error but did not")
108108
}
109109
}
110+
111+
func TestRemoveWhenLengthZero(t *testing.T) {
112+
const expected string = "Hello"
113+
sb := NewFromString(expected)
114+
115+
if err := sb.Remove(0, 0); err != nil {
116+
t.Errorf("Remove threw an error: %v", err)
117+
}
118+
119+
if result := sb.ToString(); result != expected {
120+
t.Errorf("Actual %q, Expected: %q", result, expected)
121+
}
122+
}

0 commit comments

Comments
 (0)