From 6360df8c1be46e82a751fee9280931dbeaa7b999 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 22 Jan 2009 22:30:43 -0600 Subject: [PATCH] Fix $or --- basis/help/markup/markup-tests.factor | 12 +++++++++++- basis/help/markup/markup.factor | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/basis/help/markup/markup-tests.factor b/basis/help/markup/markup-tests.factor index b9ec34a831..0d8aa53d44 100644 --- a/basis/help/markup/markup-tests.factor +++ b/basis/help/markup/markup-tests.factor @@ -1,5 +1,6 @@ USING: definitions help help.markup kernel sequences tools.test -words parser namespaces assocs generic io.streams.string accessors ; +words parser namespaces assocs generic io.streams.string accessors +strings math ; IN: help.markup.tests TUPLE: blahblah quux ; @@ -15,3 +16,12 @@ TUPLE: blahblah quux ; [ ] [ \ fooey print-topic ] unit-test [ ] [ gensym print-topic ] unit-test + +[ "a string" ] +[ [ { $or string } print-element ] with-string-writer ] unit-test + +[ "a string or an integer" ] +[ [ { $or string integer } print-element ] with-string-writer ] unit-test + +[ "a string, a fixnum, or an integer" ] +[ [ { $or string fixnum integer } print-element ] with-string-writer ] unit-test diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index 68dd66349e..2fd8d55d10 100644 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -246,7 +246,7 @@ M: f ($instance) : $or ( element -- ) dup length { { 1 [ first ($instance) ] } - { 2 [ first2 [ ($instance) " or " print-element ] [ ($instance) ] bi ] } + { 2 [ first2 [ ($instance) " or " print-element ] [ ($instance) ] bi* ] } [ drop unclip-last -- 2.11.4.GIT