Permalink
Browse files

Get tests working

  • Loading branch information...
1 parent a8ef226 commit 6696c54867c04f23104485551721532d68d3f452 @davidsklar davidsklar committed May 7, 2015
Showing with 2,255 additions and 217 deletions.
  1. +2,113 −0 run-test
  2. +0 −7 tests/{001.phpt → 001.php}
  3. +1 −0 tests/001.php.expect
  4. +1 −0 tests/001.php.skipif
  5. +4 −0 tests/002.php
  6. +1 −0 tests/002.php.expectf
  7. +1 −0 tests/002.php.skipif
  8. +0 −11 tests/002.phpt
  9. +0 −7 tests/{003.phpt → 003.php}
  10. +1 −0 tests/003.php.expect
  11. +1 −0 tests/003.php.skipif
  12. +0 −7 tests/{004.phpt → 004.php}
  13. +1 −0 tests/004.php.expect
  14. +1 −0 tests/004.php.skipif
  15. +0 −7 tests/{005.phpt → 005.php}
  16. +1 −0 tests/005.php.expect
  17. +1 −0 tests/005.php.skipif
  18. +0 −7 tests/{006.phpt → 006.php}
  19. +1 −0 tests/006.php.expect
  20. +1 −0 tests/006.php.skipif
  21. +0 −7 tests/{007.phpt → 007.php}
  22. +1 −0 tests/007.php.expect
  23. +1 −0 tests/007.php.skipif
  24. +0 −7 tests/{008.phpt → 008.php}
  25. +1 −0 tests/008.php.expect
  26. +1 −0 tests/008.php.skipif
  27. +0 −8 tests/{009.phpt → 009.php}
  28. +2 −0 tests/009.php.expect
  29. +1 −0 tests/009.php.skipif
  30. +0 −8 tests/{010.phpt → 010.php}
  31. +2 −0 tests/010.php.expect
  32. +1 −0 tests/010.php.skipif
  33. +0 −50 tests/{011.phpt → 011.php}
  34. +44 −0 tests/011.php.expectf
  35. +1 −0 tests/011.php.skipif
  36. +0 −30 tests/{012.phpt → 012.php}
  37. +24 −0 tests/012.php.expect
  38. +1 −0 tests/012.php.skipif
  39. +20 −0 tests/013.php
  40. +21 −0 tests/013.php.expect
  41. +1 −0 tests/013.php.skipif
  42. +0 −47 tests/013.phpt
  43. +0 −7 tests/{baz-23266-2.phpt → baz-23266-2.php}
  44. +1 −0 tests/baz-23266-2.php.expect
  45. +1 −0 tests/baz-23266-2.php.skipif
  46. +0 −7 tests/{baz-23266.phpt → baz-23266.php}
  47. +1 −0 tests/baz-23266.php.expect
  48. +1 −0 tests/baz-23266.php.skipif
View
Oops, something went wrong.
@@ -1,8 +1,3 @@
---TEST--
-Check for boxwood presence
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
echo "boxwood extension is available";
/*
@@ -17,5 +12,3 @@
writing regression tests
*/
?>
---EXPECT--
-boxwood extension is available
@@ -0,0 +1 @@
+boxwood extension is available
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
View
@@ -0,0 +1,4 @@
+<?php
+$r = boxwood_new();
+var_dump($r);
+?>
@@ -0,0 +1 @@
+resource(%d) of type (Boxwood)
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
View
@@ -1,11 +0,0 @@
---TEST--
-Create a resource
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
-<?php
-$r = boxwood_new();
-var_dump($r);
-?>
---EXPECTF--
-resource(%d) of type (Boxwood)
@@ -1,13 +1,6 @@
---TEST--
-Add a word
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
$r = boxwood_new();
$a = boxwood_add_text($r, "monkey");
$b = boxwood_add_text($r, "salad");
print "$a,$b";
?>
---EXPECT--
-6,5
@@ -0,0 +1 @@
+6,5
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
@@ -1,14 +1,7 @@
---TEST--
-Do replacement
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
$r = boxwood_new();
$a = boxwood_add_text($r, "monkey");
$b = boxwood_add_text($r, "salad");
$c = boxwood_replace_text($r, "My monkey ate some salad today.","*");
print $c;
?>
---EXPECT--
-My m***** ate some s**** today.
@@ -0,0 +1 @@
+My m***** ate some s**** today.
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
@@ -1,14 +1,7 @@
---TEST--
-Do case-insensitive replacement
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
$r = boxwood_new(false);
$a = boxwood_add_text($r, "Monkey");
$b = boxwood_add_text($r, "salad");
$c = boxwood_replace_text($r, "My monkey ate some Salad today.","!");
print $c;
?>
---EXPECT--
-My m!!!!! ate some S!!!! today.
@@ -0,0 +1 @@
+My m!!!!! ate some S!!!! today.
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
@@ -1,14 +1,7 @@
---TEST--
-Do replacement with explicit no-case-insensitivity argument
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
$r = boxwood_new(false);
$a = boxwood_add_text($r, "monkey");
$b = boxwood_add_text($r, "salad");
$c = boxwood_replace_text($r, "My monkey ate some salad today.","~");
print $c;
?>
---EXPECT--
-My m~~~~~ ate some s~~~~ today.
@@ -0,0 +1 @@
+My m~~~~~ ate some s~~~~ today.
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
@@ -1,8 +1,3 @@
---TEST--
-Replacement, UTF-8, case-sensitive
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
$r = boxwood_new(true);
boxwood_add_text($r, "monkey");
@@ -11,5 +6,3 @@
$c = boxwood_replace_text($r, "My monkey ate some salad today and also some ŚÄłäđ and śäłäđ.","^");
print $c;
?>
---EXPECT--
-My m^^^^^ ate some s^^^^ today and also some Ś^^^^ and śäłäđ.
@@ -0,0 +1 @@
+My m^^^^^ ate some s^^^^ today and also some Ś^^^^ and śäłäđ.
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
@@ -1,8 +1,3 @@
---TEST--
-Replacement, UTF-8, case-insensitive
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
$r = boxwood_new(false);
boxwood_add_text($r, "monkey");
@@ -11,5 +6,3 @@
$c = boxwood_replace_text($r, "My monkey ate some salad today and also some ŚÄłäđ and śäłäđ.","*");
print $c;
?>
---EXPECT--
-My m***** ate some s**** today and also some Ś**** and ś****.
@@ -0,0 +1 @@
+My m***** ate some s**** today and also some Ś**** and ś****.
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
@@ -1,8 +1,3 @@
---TEST--
-Prefix on word list
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
$r = boxwood_new();
boxwood_add_text($r, "mon");
@@ -19,6 +14,3 @@
$c = boxwood_replace_text($r, "a mont monkeys mono eat monotremes",'*');
print $c;
?>
---EXPECT--
-a m**t m*****s m**o eat m********s
-a m**t m*****s m**o eat m********s
@@ -0,0 +1,2 @@
+a m**t m*****s m**o eat m********s
+a m**t m*****s m**o eat m********s
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
@@ -1,8 +1,3 @@
---TEST--
-Array of words to replace
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) print "skip"; ?>
---FILE--
<?php
$r = boxwood_new();
boxwood_add_text($r, "mon");
@@ -12,6 +7,3 @@
$c = boxwood_replace_text($r, $a,'*');
print implode('-', $a) . "\n";
print implode('-', $c) . "\n";
---EXPECT--
-a-mont-monkeys-mono-eat-monotremes
-a-m**t-m*****s-m**o-eat-m********s
@@ -0,0 +1,2 @@
+a-mont-monkeys-mono-eat-monotremes
+a-m**t-m*****s-m**o-eat-m********s
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) print "skip"; ?>
@@ -1,8 +1,3 @@
---TEST--
-Word boundary tests
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) echo "skip"; ?>
---FILE--
<?php
$r = boxwood_new();
boxwood_add_text($r, "xxx");
@@ -31,48 +26,3 @@
echo "\n";
}
?>
---EXPECTF--
-aaa x** bbb
-aaa x** bbb
-
-aaax**
-aaaxxx
-
-x**bbb
-xxxbbb
-
-aaax**bbb
-aaaxxxbbb
-
-aaa(x**)bbb
-aaa(x**)bbb
-
-x** bbb
-x** bbb
-
-aaa x**
-aaa x**
-
-aaa?x**!bbb
-aaa?x**!bbb
-
-ax**
-axxx
-
-x**b
-xxxb
-
-x**
-x**
-
-(x**
-(x**
-
-x**)
-x**)
-
-aaa%ax**
-aaa%ax**
-
-aaa%ax**
-aaa%axxx
View
@@ -0,0 +1,44 @@
+aaa x** bbb
+aaa x** bbb
+
+aaax**
+aaaxxx
+
+x**bbb
+xxxbbb
+
+aaax**bbb
+aaaxxxbbb
+
+aaa(x**)bbb
+aaa(x**)bbb
+
+x** bbb
+x** bbb
+
+aaa x**
+aaa x**
+
+aaa?x**!bbb
+aaa?x**!bbb
+
+ax**
+axxx
+
+x**b
+xxxb
+
+x**
+x**
+
+(x**
+(x**
+
+x**)
+x**)
+
+aaa%ax**
+aaa%ax**
+
+aaa%ax**
+aaa%axxx
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) echo "skip"; ?>
@@ -1,8 +1,3 @@
---TEST--
-Word boundary tests with alternate boundary set
---SKIPIF--
-<?php if (!extension_loaded("boxwood")) echo "skip"; ?>
---FILE--
<?php
$def = boxwood_new();
$alt = boxwood_new();
@@ -26,28 +21,3 @@
echo "\n";
}
?>
---EXPECT--
-aaax**
-aaaxxx
-aaax**
-aaaxxx
-
-aaa x** bbb
-aaa x** bbb
-aaa x** bbb
-aaa xxx bbb
-
-aaa(x**)bbb
-aaa(x**)bbb
-aaa(x**)bbb
-aaa(x**)bbb
-
-x**
-x**
-x**
-x**
-
-aaa-x**-bbb
-aaa-x**-bbb
-aaa-x**-bbb
-aaa-xxx-bbb
View
@@ -0,0 +1,24 @@
+aaax**
+aaaxxx
+aaax**
+aaaxxx
+
+aaa x** bbb
+aaa x** bbb
+aaa x** bbb
+aaa xxx bbb
+
+aaa(x**)bbb
+aaa(x**)bbb
+aaa(x**)bbb
+aaa(x**)bbb
+
+x**
+x**
+x**
+x**
+
+aaa-x**-bbb
+aaa-x**-bbb
+aaa-x**-bbb
+aaa-xxx-bbb
@@ -0,0 +1 @@
+<?php if (!extension_loaded("boxwood")) echo "skip"; ?>
View
@@ -0,0 +1,20 @@
+<?php
+$r = boxwood_new();
+boxwood_add_text($r, "ɹǝqɯǝɯ");
+
+$tests = array(
+ 'ǝɔuǝıɹǝdxǝ ɹǝqɯǝɯ ɐƃǝɯo',
+ 'ǝɔuǝıɹǝdxǝɹǝqɯǝɯ ɐƃǝɯo',
+ 'ǝɔuǝıɹǝdxǝ ɹǝqɯǝɯɐƃǝɯo',
+ 'ǝɔuǝıɹǝdxǝɹǝqɯǝɯɐƃǝɯo',
+ 'ǝɔuǝıɹǝdxǝ(ɹǝqɯǝɯ)ɐƃǝɯo',
+ 'ɹǝqɯǝɯ ɐƃǝɯo',
+ 'ǝɔuǝıɹǝdxǝ ɹǝqɯǝɯ',
+);
+
+foreach ($tests as $test) {
+ echo boxwood_replace_text($r, $test, '*', false), "\n";
+ echo boxwood_replace_text($r, $test, '*', true), "\n";
+ echo "\n";
+}
+?>
Oops, something went wrong.

0 comments on commit 6696c54

Please sign in to comment.