groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Add a testcase for the `containsKey` of `CommonCache`
Date Mon, 11 Dec 2017 02:14:43 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 06b295681 -> d8b8e9865


Add a testcase for the `containsKey` of `CommonCache`


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/d8b8e986
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/d8b8e986
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/d8b8e986

Branch: refs/heads/master
Commit: d8b8e9865f72f985474a53a497461684789a3530
Parents: 06b2956
Author: sunlan <sunlan@apache.org>
Authored: Mon Dec 11 10:14:37 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Mon Dec 11 10:14:37 2017 +0800

----------------------------------------------------------------------
 .../groovy/runtime/memoize/CommonCacheTest.java       | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/d8b8e986/src/test/org/codehaus/groovy/runtime/memoize/CommonCacheTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/memoize/CommonCacheTest.java b/src/test/org/codehaus/groovy/runtime/memoize/CommonCacheTest.java
index 9bbb08b..9fb4350 100644
--- a/src/test/org/codehaus/groovy/runtime/memoize/CommonCacheTest.java
+++ b/src/test/org/codehaus/groovy/runtime/memoize/CommonCacheTest.java
@@ -102,6 +102,20 @@ public class CommonCacheTest {
     }
 
     @Test
+    public void containsKey() {
+        CommonCache<String, String> sc =
+                new CommonCache<>(
+                        new LinkedHashMap<>(
+                                Maps.of("name", "Daniel",
+                                        "gender", "Male",
+                                        "city", "Shanghai")
+                        )
+                );
+
+        Assert.assertTrue(sc.containsKey("name"));
+    }
+
+    @Test
     public void size() {
         CommonCache<String, String> sc =
                 new CommonCache<>(


Mime
View raw message