diff options
-rw-r--r-- | tests/010/hash.tl | 18 | ||||
-rw-r--r-- | txr.1 | 5 |
2 files changed, 22 insertions, 1 deletions
diff --git a/tests/010/hash.tl b/tests/010/hash.tl index db8f07aa..415dd223 100644 --- a/tests/010/hash.tl +++ b/tests/010/hash.tl @@ -63,3 +63,21 @@ (test [hash-map square '(1 2 3)] #H(() (1 1) (2 4) (3 9))) + +(let ((h1 #H(() (a 1) (b 2) (c 3) (d 4))) + (h2 #H(() (b -2) (c -3) (d -4) (e -5)))) + (mtest + (hash-uni h1 h2) #H(() (a 1) (b 2) (c 3) (d 4) (e -5)) + [hash-uni h1 h2 +] #H(() (a 1) (b 0) (c 0) (d 0) (e -5)) + [hash-uni h1 h2 + -] #H(() (a -1) (b -4) (c -6) (d -8) (e -5)) + [hash-uni h1 h2 + : -] #H(() (a 1) (b 4) (c 6) (d 8) (e 5)) + [hash-uni h1 h2 + - -] #H(() (a -1) (b 0) (c 0) (d 0) (e 5))) + (mtest + (hash-diff h1 h2) #H(() (a 1)) + (hash-diff h2 h1) #H(() (e -5))) + (mtest + (hash-symdiff h1 h2) #H(() (a 1) (e -5)) + (hash-symdiff h2 h1) #H(() (a 1) (e -5))) + (mtest + (hash-isec h1 h2) #H(() (b 2) (c 3) (d 4)) + [hash-isec h1 h2 +] #H(() (b 0) (c 0) (d 0)))) @@ -57736,7 +57736,10 @@ Similarly, if .meta map2fun is present, specifies a function through which values from .meta hash2 -are projected. +are projected. These two functions are independent of +.metn joinfun ; +they are applied to values without regard for whether their +keys exist in both hashes or just one. The .code hash-diff |