]> gitweb.factorcode.org Git - factor.git/blob - extra/backtrack/backtrack-tests.factor
mason: show git SHA1 and timestamp of last completed build
[factor.git] / extra / backtrack / backtrack-tests.factor
1 ! Copyright (c) 2009 Samuel Tardieu.
2 ! See See http://factorcode.org/license.txt for BSD license.
3 USING: backtrack math tools.test ;
4
5 cut-amb
6 { 1 } [ { 1 2 } amb ] unit-test
7 { V{ { 1 2 } } } [ [ { 1 2 } ] bag-of ] unit-test
8 { V{ 1 2 } } [ [ { 1 2 } amb ] bag-of ] unit-test
9 [ cut-amb { } amb ] must-fail
10 [ fail ] must-fail
11 { V{ 1 10 2 20 } } [ [ { 1 2 } amb { 1 10 } amb * ] bag-of ] unit-test
12 { V{ 7 -1 } } [ [ 3 4 { + - } amb-execute ] bag-of ] unit-test
13 { "foo" t } [ [ "foo" t ] [ "bar" ] if-amb ] unit-test
14 { "bar" f } [ [ "foo" f ] [ "bar" ] if-amb ] unit-test
15 { "bar" f } [ [ "foo" fail ] [ "bar" ] if-amb ] unit-test