diff options
Diffstat (limited to 'android/config_test.go')
-rw-r--r-- | android/config_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/android/config_test.go b/android/config_test.go index 7bfc800e6..a11115d9d 100644 --- a/android/config_test.go +++ b/android/config_test.go @@ -100,6 +100,22 @@ func TestConfiguredJarList(t *testing.T) { assertStringEquals(t, "apex1:jarA", list1.String()) }) + t.Run("create invalid - missing apex", func(t *testing.T) { + defer func() { + err := recover().(error) + assertStringEquals(t, "malformed (apex, jar) pair: 'jarA', expected format: <apex>:<jar>", err.Error()) + }() + CreateTestConfiguredJarList([]string{"jarA"}) + }) + + t.Run("create invalid - empty apex", func(t *testing.T) { + defer func() { + err := recover().(error) + assertStringEquals(t, "invalid apex '' in <apex>:<jar> pair ':jarA', expected format: <apex>:<jar>", err.Error()) + }() + CreateTestConfiguredJarList([]string{":jarA"}) + }) + list2 := list1.Append("apex2", "jarB") t.Run("append", func(t *testing.T) { assertStringEquals(t, "apex1:jarA,apex2:jarB", list2.String()) |