factor/basis/peg/search/search-tests.factor

19 lines
476 B
Factor
Raw Normal View History

! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
2008-03-06 14:46:15 -05:00
USING: kernel math math.parser arrays tools.test peg peg.parsers
peg.search ;
2008-03-01 17:00:45 -05:00
IN: peg.search.tests
{ V{ 123 456 } } [
2008-01-06 12:30:23 -05:00
"abc 123 def 456" 'integer' search
] unit-test
{ V{ 123 "hello" 456 } } [
2008-01-06 12:30:23 -05:00
"one 123 \"hello\" two 456" 'integer' 'string' 2array choice search
] unit-test
{ "abc 246 def 912" } [
2008-01-06 12:30:23 -05:00
"abc 123 def 456" 'integer' [ 2 * number>string ] action replace
] unit-test