]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/assocs/extras/extras-tests.factor
assocs: move some -of words to extras
[factor.git] / extra / assocs / extras / extras-tests.factor
index 22e7ec8f1700a55b5360376cbc99192e7515e4c9..2ca1b4cd67bf8132a1fb9b08e8fd0a2efd84b744 100644 (file)
@@ -321,3 +321,44 @@ USING: arrays assocs.extras kernel math math.order sequences tools.test ;
     H{ { 1 2 } { 3 4 } { 5 6 } }
     { 1 3 } { } intersect-keys-as
 ] unit-test
+
+
+{ H{ { 1 100 } } } [
+    H{ } clone 1 100 set-of
+] unit-test
+
+{ H{ { 1 V{ 100 200 } } } } [
+    H{ } clone 1 100 push-of 1 200 push-of
+] unit-test
+
+{ H{ { 123 556 } } } [
+    H{ { 123 456 } } 123 [ 100 + ] change-of
+] unit-test
+
+{ H{ { 123 556 } } } [
+    H{ { 123 456 } } 123 [ 100 + ] ?change-of
+] unit-test
+
+{ H{ { 123 456 } } } [
+    H{ { 123 456 } } 1234 [ 100 + ] ?change-of
+] unit-test
+
+{ H{ { 10 2 } } } [
+    H{ { 10 1 } } 10 inc-of
+] unit-test
+
+{ H{ { 10 1001 } } } [
+    H{ { 10 1 } } 10 1000 of+
+] unit-test
+
+{ H{ { 1 100 } } f } [
+    H{ { 1 100 } } 1 100 maybe-set-of
+] unit-test
+
+{ H{ { 1 100 } { 2 100 } } t } [
+    H{ { 1 100 } } 2 100 maybe-set-of
+] unit-test
+
+{ H{ { 1 100 } } t } [
+    H{ { 1 100 } } 1 101 maybe-set-of
+] unit-test
\ No newline at end of file