 [ t ] [ 8 i3 in? ] unit-test
 [ f ] [ 9 i3 in? ] unit-test
 
-: i4 ( -- set )
+CONSTANT: i4 $[
     { { 2 4 } } <interval-set>
     { { 6 8 } } <interval-set>
-    <interval-and> ;
+    <interval-and> ]
 
 [ f ] [ 1 i4 in? ] unit-test
 [ f ] [ 2 i4 in? ] unit-test

! Copyright (C) 2009 Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test interval-sets math grouping sequences accessors
combinators.short-circuit ;
IN: interval-sets.tests

[ f ] [ 0 T{ interval-set } in? ] unit-test
[ f ] [ 2 T{ interval-set } in? ] unit-test

: i1 ( -- set )
    { { 3 4 } } <interval-set> ;

[ f ] [ 2 i1 in? ] unit-test
[ t ] [ 3 i1 in? ] unit-test


CONSTANT: unicode-max 0x10FFFF

CONSTANT: i2 $[
    { { 3 4 } } <interval-set>
    unicode-max <interval-not> ]

[ t ] [ 2 i2 in? ] unit-test
[ f ] [ 3 i2 in? ] unit-test
[ f ] [ 4 i2 in? ] unit-test
[ t ] [ 5 i2 in? ] unit-test

CONSTANT: i3 $[
    { { 2 4 } } <interval-set>
    { { 6 8 } } <interval-set>
    <interval-or> ]

[ f ] [ 1 i3 in? ] unit-test
[ t ] [ 2 i3 in? ] unit-test
