]> gitweb.factorcode.org Git - factor.git/commitdiff
Add a deploy test to keep benchmark.regex-dna size down
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 18 Mar 2009 22:08:57 +0000 (17:08 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 18 Mar 2009 22:08:57 +0000 (17:08 -0500)
basis/tools/deploy/deploy-tests.factor
extra/benchmark/regex-dna/regex-dna.factor

index 3a2f960fc93713b346f70eeadd3f601406eeabc7..0a7549430d6d1c5e4042853984e933f983a977b1 100644 (file)
@@ -26,6 +26,8 @@ os macosx? [
     [ t ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test\r
 ] when\r
 \r
+[ t ] [ "benchmark.regex-dna" shake-and-bake 1200000 small-enough? ] unit-test\r
+\r
 {\r
     "tools.deploy.test.1"\r
     "tools.deploy.test.2"\r
index 5c11be357f790e8386b02cc50c9482a92ad9d2fa..24e77597831e5f180a64ef74eacaf5199d8156a3 100644 (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 ;