From 60fb68d1de99f7e9728b305a2c24ba2749c00ad8 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 26 Apr 2008 18:44:28 -0500 Subject: [PATCH] rename state-parser:rest to take-rest --- extra/calendar/calendar-tests.factor | 6 +++++- extra/calendar/format/format-tests.factor | 2 +- extra/multi-methods/tests/topological-sort.factor | 3 ++- extra/state-parser/state-parser-tests.factor | 12 ++++++------ extra/state-parser/state-parser.factor | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/extra/calendar/calendar-tests.factor b/extra/calendar/calendar-tests.factor index d4cddb6081..e2a2bc7e66 100755 --- a/extra/calendar/calendar-tests.factor +++ b/extra/calendar/calendar-tests.factor @@ -1,5 +1,5 @@ USING: arrays calendar kernel math sequences tools.test -continuations system math.order ; +continuations system math.order threads ; IN: calendar.tests \ time+ must-infer @@ -163,3 +163,7 @@ IN: calendar.tests [ t ] [ 5 months checktime+ ] unit-test [ t ] [ 5 years checktime+ ] unit-test + +[ t ] [ now 50 milliseconds sleep now before? ] unit-test +[ t ] [ now 50 milliseconds sleep now swap after? ] unit-test +[ t ] [ now 50 milliseconds sleep now 50 milliseconds sleep now swapd between? ] unit-test diff --git a/extra/calendar/format/format-tests.factor b/extra/calendar/format/format-tests.factor index 1ba892bef3..2eef21a013 100755 --- a/extra/calendar/format/format-tests.factor +++ b/extra/calendar/format/format-tests.factor @@ -1,5 +1,5 @@ USING: calendar.format calendar kernel math tools.test -io.streams.string accessors io ; +io.streams.string accessors io math.order ; IN: calendar.format.tests [ 0 ] [ diff --git a/extra/multi-methods/tests/topological-sort.factor b/extra/multi-methods/tests/topological-sort.factor index ed8bece4ba..cea7022759 100644 --- a/extra/multi-methods/tests/topological-sort.factor +++ b/extra/multi-methods/tests/topological-sort.factor @@ -1,5 +1,6 @@ +USING: kernel multi-methods tools.test math arrays sequences +math.order ; IN: multi-methods.tests -USING: kernel multi-methods tools.test math arrays sequences ; [ { 1 2 3 4 5 6 } ] [ { 6 4 5 1 3 2 } [ <=> ] topological-sort diff --git a/extra/state-parser/state-parser-tests.factor b/extra/state-parser/state-parser-tests.factor index 4e1ecaddfc..e0b274b3e6 100755 --- a/extra/state-parser/state-parser-tests.factor +++ b/extra/state-parser/state-parser-tests.factor @@ -1,8 +1,8 @@ USING: tools.test state-parser kernel io strings ascii ; -[ "hello" ] [ "hello" [ rest ] string-parse ] unit-test -[ 2 4 ] [ "12\n123" [ rest drop get-line get-column ] string-parse ] unit-test -[ "hi" " how are you?" ] [ "hi how are you?" [ [ get-char blank? ] take-until rest ] string-parse ] unit-test -[ "foo" ";bar" ] [ "foo;bar" [ CHAR: ; take-char rest ] string-parse ] unit-test -[ "foo " " bar" ] [ "foo and bar" [ "and" take-string rest ] string-parse ] unit-test -[ "baz" ] [ " \n\t baz" [ pass-blank rest ] string-parse ] unit-test +[ "hello" ] [ "hello" [ take-rest ] string-parse ] unit-test +[ 2 4 ] [ "12\n123" [ take-rest drop get-line get-column ] string-parse ] unit-test +[ "hi" " how are you?" ] [ "hi how are you?" [ [ get-char blank? ] take-until take-rest ] string-parse ] unit-test +[ "foo" ";bar" ] [ "foo;bar" [ CHAR: ; take-char take-rest ] string-parse ] unit-test +[ "foo " " bar" ] [ "foo and bar" [ "and" take-string take-rest ] string-parse ] unit-test +[ "baz" ] [ " \n\t baz" [ pass-blank take-rest ] string-parse ] unit-test diff --git a/extra/state-parser/state-parser.factor b/extra/state-parser/state-parser.factor index 6a3bf1d552..96ad4ca0b4 100644 --- a/extra/state-parser/state-parser.factor +++ b/extra/state-parser/state-parser.factor @@ -99,7 +99,7 @@ SYMBOL: prolog-data dup slip swap dup [ get-char , ] unless ] skip-until ] "" make nip ; inline -: rest ( -- string ) +: take-rest ( -- string ) [ f ] take-until ; : take-char ( ch -- string )