]> gitweb.factorcode.org Git - factor.git/blob - extra/peg/search/search-tests.factor
Fix conflict
[factor.git] / extra / peg / search / search-tests.factor
1 ! Copyright (C) 2007 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
3 !
4 USING: kernel math math.parser arrays tools.test peg peg.search ;
5 IN: temporary
6
7 { V{ 123 456 } } [
8   "abc 123 def 456" 'integer' search
9 ] unit-test
10
11 { V{ 123 "hello" 456 } } [
12   "one 123 \"hello\" two 456" 'integer' 'string' 2array choice search
13 ] unit-test
14
15 { "abc 246 def 912" } [
16   "abc 123 def 456" 'integer' [ 2 * number>string ] action replace
17 ] unit-test
18