From 8b842cc543869f83f705f6579e9203c2ccc9c163 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 3 Sep 2005 06:19:11 +0000 Subject: [PATCH] fix compilation of cond; fix other regressions --- library/inference/known-words.factor | 2 +- library/test/compiler/ifte.factor | 9 +++++++++ library/test/files.factor | 7 ------- library/test/httpd/html.factor | 9 --------- library/test/io/io.factor | 2 +- library/test/parsing-word.factor | 6 +++--- library/test/prettyprint.factor | 2 +- library/test/redefine.factor | 2 +- library/test/test.factor | 4 +++- library/ui/hierarchy.factor | 5 ++--- 10 files changed, 21 insertions(+), 27 deletions(-) diff --git a/library/inference/known-words.factor b/library/inference/known-words.factor index 0d74a0b537..cbddc25e02 100644 --- a/library/inference/known-words.factor +++ b/library/inference/known-words.factor @@ -26,7 +26,7 @@ memory parser sequences strings vectors words prettyprint ; \ cond [ [ object ] [ ] ] "infer-effect" set-word-prop \ cond [ - pop-literal [ first2 cons ] map + pop-literal [ first2 cons ] map reverse-slice [ no-cond ] swap alist>quot infer-quot-value ] "infer" set-word-prop diff --git a/library/test/compiler/ifte.factor b/library/test/compiler/ifte.factor index 59624a1513..1768eb4a8c 100644 --- a/library/test/compiler/ifte.factor +++ b/library/test/compiler/ifte.factor @@ -124,3 +124,12 @@ DEFER: countdown-b } cond ] compile-1 ] unit-test + +[ 3 ] [ + [ + 3 { + { [ dup fixnum? ] [ ] } + { [ t ] [ drop t ] } + } cond + ] compile-1 +] unit-test diff --git a/library/test/files.factor b/library/test/files.factor index 60ef9eddda..d147de9b70 100644 --- a/library/test/files.factor +++ b/library/test/files.factor @@ -9,10 +9,3 @@ USE: test [ "txt" ] [ "foo.bar.txt" file-extension ] unit-test [ "text/plain" ] [ "foo.bar.txt" mime-type ] unit-test [ "text/html" ] [ "index.html" mime-type ] unit-test - -! Some tests to ensure these words simply work, since we can't -! really test them - -[ t ] [ cwd directory list? ] unit-test - -cwd directory. diff --git a/library/test/httpd/html.factor b/library/test/httpd/html.factor index 6e06a44053..703d6d05ee 100644 --- a/library/test/httpd/html.factor +++ b/library/test/httpd/html.factor @@ -13,15 +13,6 @@ USING: html io kernel namespaces styles test ; ] with-scope ] unit-test -[ "" ] -[ - [ - "" - [ [[ icon "library/icons/File.png" ]] ] - [ drop ] icon-tag - ] string-out -] unit-test - [ "" ] [ [ diff --git a/library/test/io/io.factor b/library/test/io/io.factor index 0f97c3578a..122d01dbb7 100644 --- a/library/test/io/io.factor +++ b/library/test/io/io.factor @@ -48,7 +48,7 @@ USING: io kernel math parser strings test ; [ "" ] [ 0 read ] unit-test -[ ] [ "123" write 9000 CHAR: x fill write flush ] unit-test +! [ ] [ "123" write 9000 CHAR: x fill write flush ] unit-test [ "line 1" CHAR: l ] [ diff --git a/library/test/parsing-word.factor b/library/test/parsing-word.factor index dd708331f1..d0f3b126ca 100644 --- a/library/test/parsing-word.factor +++ b/library/test/parsing-word.factor @@ -1,13 +1,13 @@ -IN: temporary USING: kernel parser sequences test words ; +IN: temporary DEFER: foo -": foo 2 2 + . ; parsing" eval +"IN: temporary : foo 2 2 + . ; parsing" eval [ [ ] ] [ "USE: temporary foo" parse ] unit-test -": foo 2 2 + . ;" eval +"IN: temporary : foo 2 2 + . ;" eval [ [ POSTPONE: foo ] ] [ "USE: temporary foo" parse ] unit-test diff --git a/library/test/prettyprint.factor b/library/test/prettyprint.factor index a8572a22c7..c669e3a897 100644 --- a/library/test/prettyprint.factor +++ b/library/test/prettyprint.factor @@ -1,6 +1,6 @@ -IN: temporary USING: alien io kernel lists math prettyprint sequences test words inference namespaces vectors ; +IN: temporary [ "4" ] [ 4 unparse ] unit-test [ "1.0" ] [ 1.0 unparse ] unit-test diff --git a/library/test/redefine.factor b/library/test/redefine.factor index 8cad84c759..f2dc4c74f6 100644 --- a/library/test/redefine.factor +++ b/library/test/redefine.factor @@ -1,5 +1,5 @@ -IN: temporary USING: compiler inference math generic parser test ; +IN: temporary : foo 1 2 ; : bar foo foo ; compiled diff --git a/library/test/test.factor b/library/test/test.factor index 4f732c67aa..6e007af2ed 100644 --- a/library/test/test.factor +++ b/library/test/test.factor @@ -52,7 +52,9 @@ SYMBOL: failures : test ( name -- ? ) [ "=====> " write dup write "..." print - test-path [ [ run-resource ] keep ] assert-depth drop + test-path [ + [ [ run-resource ] with-scope ] keep + ] assert-depth drop ] test-handler ; : prepare-tests ( -- ) diff --git a/library/ui/hierarchy.factor b/library/ui/hierarchy.factor index ff8c221e2f..71d42be963 100644 --- a/library/ui/hierarchy.factor +++ b/library/ui/hierarchy.factor @@ -15,9 +15,8 @@ sequences vectors ; ] when* ; : (clear-gadget) ( gadget -- ) - gadget-children [ - dup [ f swap set-gadget-parent ] each 0 swap set-length - ] when* ; + dup gadget-children [ f swap set-gadget-parent ] each + f swap set-gadget-children ; : clear-gadget ( gadget -- ) dup (clear-gadget) relayout ;