Add a deploy test to keep benchmark.regex-dna size down

db4
Slava Pestov 2009-03-18 17:08:57 -05:00
parent d60e586f48
commit 1d45720579
2 changed files with 9 additions and 7 deletions

View File

@ -26,6 +26,8 @@ os macosx? [
[ t ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test
] when
[ t ] [ "benchmark.regex-dna" shake-and-bake 1200000 small-enough? ] unit-test
{
"tools.deploy.test.1"
"tools.deploy.test.2"

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Slava Pestov.
! Copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors prettyprint io io.encodings.ascii
io.files kernel sequences assocs namespaces regexp ;
USING: accessors io io.encodings.ascii io.files kernel sequences
assocs math.parser namespaces regexp ;
IN: benchmark.regex-dna
! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=ruby&id=1
@ -22,7 +22,7 @@ IN: benchmark.regex-dna
R/ agggtaa[cgt]|[acg]ttaccct/i
} [
[ raw>> write bl ]
[ count-matches . ]
[ count-matches number>string print ]
bi
] with each ;
@ -50,9 +50,9 @@ SYMBOL: clen
dup count-patterns
do-replacements
nl
ilen get .
clen get .
length . ;
ilen get number>string print
clen get number>string print
length number>string print ;
: regex-dna-main ( -- )
"resource:extra/benchmark/regex-dna/regex-dna-test-in.txt" regex-dna ;