summaryrefslogtreecommitdiff
path: root/android/util_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/util_test.go')
-rw-r--r--android/util_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/android/util_test.go b/android/util_test.go
index 5584b38f7..a2ef58958 100644
--- a/android/util_test.go
+++ b/android/util_test.go
@@ -381,6 +381,14 @@ func TestRemoveFromList(t *testing.T) {
}
}
+func TestCopyOfEmptyAndNil(t *testing.T) {
+ emptyList := []string{}
+ copyOfEmptyList := CopyOf(emptyList)
+ AssertBoolEquals(t, "Copy of an empty list should be an empty list and not nil", true, copyOfEmptyList != nil)
+ copyOfNilList := CopyOf(nil)
+ AssertBoolEquals(t, "Copy of a nil list should be a nil list and not an empty list", true, copyOfNilList == nil)
+}
+
func ExampleCopyOf() {
a := []string{"1", "2", "3"}
b := CopyOf(a)