[Gd-chatter] r11375 - in trunk/libraries: registry/generic regular-expressions regular-expressions/tests

cgay at gwydiondylan.org cgay at gwydiondylan.org
Thu May 24 13:10:00 CEST 2007


Author: cgay
Date: Thu May 24 13:09:59 2007
New Revision: 11375

Added:
   trunk/libraries/registry/generic/regular-expressions-test-suite   (contents, props changed)
   trunk/libraries/registry/generic/regular-expressions-test-suite-app   (contents, props changed)
   trunk/libraries/regular-expressions/
   trunk/libraries/regular-expressions/tests/
   trunk/libraries/regular-expressions/tests/app-library.dylan   (contents, props changed)
   trunk/libraries/regular-expressions/tests/library.dylan   (contents, props changed)
   trunk/libraries/regular-expressions/tests/regular-expressions-test-suite-app.dylan   (contents, props changed)
   trunk/libraries/regular-expressions/tests/regular-expressions-test-suite-app.lid   (contents, props changed)
   trunk/libraries/regular-expressions/tests/regular-expressions-test-suite.dylan   (contents, props changed)
   trunk/libraries/regular-expressions/tests/regular-expressions-test-suite.lid   (contents, props changed)
Log:
job: 7357
The beginnings of a regular expressions test suite, in the future home of the
regular-expressions library.

Added: trunk/libraries/registry/generic/regular-expressions-test-suite
==============================================================================
--- (empty file)
+++ trunk/libraries/registry/generic/regular-expressions-test-suite	Thu May 24 13:09:59 2007
@@ -0,0 +1 @@
+abstract://dylan/regular-expressions/tests/regular-expressions-test-suite.lid

Added: trunk/libraries/registry/generic/regular-expressions-test-suite-app
==============================================================================
--- (empty file)
+++ trunk/libraries/registry/generic/regular-expressions-test-suite-app	Thu May 24 13:09:59 2007
@@ -0,0 +1 @@
+abstract://dylan/regular-expressions/tests/regular-expressions-test-suite-app.lid

Added: trunk/libraries/regular-expressions/tests/app-library.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/regular-expressions/tests/app-library.dylan	Thu May 24 13:09:59 2007
@@ -0,0 +1,13 @@
+Module:    dylan-user
+Author:    Carl Gay
+Synopsis:  An application library for regular-expressions-test-suite
+
+define library regular-expressions-test-suite-app
+  use regular-expressions-test-suite;
+  use testworks;
+end;
+
+define module regular-expressions-test-suite-app
+  use regular-expressions-test-suite;
+  use testworks;
+end;

Added: trunk/libraries/regular-expressions/tests/library.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/regular-expressions/tests/library.dylan	Thu May 24 13:09:59 2007
@@ -0,0 +1,20 @@
+Module: dylan-user
+
+define library regular-expressions-test-suite
+  use common-dylan;
+  use testworks;
+  use regular-expressions;
+
+  export
+    regular-expressions-test-suite;
+end;
+
+define module regular-expressions-test-suite
+  use common-dylan, exclude: { split };
+  use regular-expressions;
+  use testworks;
+
+  export
+    //pcre-test-suite,
+    regular-expressions-test-suite;
+end;

Added: trunk/libraries/regular-expressions/tests/regular-expressions-test-suite-app.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/regular-expressions/tests/regular-expressions-test-suite-app.dylan	Thu May 24 13:09:59 2007
@@ -0,0 +1,3 @@
+Module: regular-expressions-test-suite-app
+
+run-test-application(regular-expressions-test-suite);

Added: trunk/libraries/regular-expressions/tests/regular-expressions-test-suite-app.lid
==============================================================================
--- (empty file)
+++ trunk/libraries/regular-expressions/tests/regular-expressions-test-suite-app.lid	Thu May 24 13:09:59 2007
@@ -0,0 +1,3 @@
+library: regular-expressions-test-suite-app
+files: app-library
+       regular-expressions-test-suite-app

Added: trunk/libraries/regular-expressions/tests/regular-expressions-test-suite.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/regular-expressions/tests/regular-expressions-test-suite.dylan	Thu May 24 13:09:59 2007
@@ -0,0 +1,39 @@
+Module: regular-expressions-test-suite
+Author: Carl Gay
+
+
+define function re/position (string, pattern, #rest args)
+  let (#rest marks) = apply(regexp-position, string, pattern, args);
+  marks
+end function re/position;
+
+define test atom-test ()
+  check-equal("atom-1", re/position("a", "a"),      #[0, 1]);
+  check-equal("atom-2", re/position("a", "[a]"),    #[0, 1]);
+  check-equal("atom-3", re/position("ab", "(a)b"),  #[0, 2, 0, 1]);
+  check-equal("atom-4", re/position("a", "\\w"),    #[0, 1]);
+  check-equal("atom-5", re/position("a", "."),      #[0, 1]);
+  check-equal("atom-6", re/position("a", "a{0}"),   #[0, 0]);
+  check-equal("atom-7", re/position("aa", "a{2}"),  #[0, 2]);
+  check-equal("atom-8", re/position("aa", "a{1,}"), #[0, 2]);
+  check-equal("atom-9", re/position("aaa", "a{1,8}"), #[0, 3]);
+  check-equal("atom-A", re/position("", "a{,}"),   #[0, 0]);
+  check-equal("atom-A1", re/position("aaaaaa", "a{,}"),   #[0, 6]);
+  check-condition("atom-B", <illegal-regexp>, re/position("", "a{m,n}"));
+  check-condition("atom-C", <illegal-regexp>, re/position("", "a{m,}"));
+  check-condition("atom-D", <illegal-regexp>, re/position("", "a{,n}"));
+  check-condition("atom-E", <illegal-regexp>, re/position("", "a{m}"));
+  check-condition("atom-F", <illegal-regexp>, re/position("", "a{,"));
+  check-condition("atom-G", <illegal-regexp>, re/position("", "[a"));
+  check-condition("atom-H", <illegal-regexp>, re/position("", "\\"));
+  check-equal("atom-tan", "\<65>", "A");
+end;
+
+
+define suite regular-expressions-test-suite ()
+  test atom-test;
+//  test and-test;
+//  test or-test;
+//  test anchoring-test;
+//  test quantifier-test;
+end;

Added: trunk/libraries/regular-expressions/tests/regular-expressions-test-suite.lid
==============================================================================
--- (empty file)
+++ trunk/libraries/regular-expressions/tests/regular-expressions-test-suite.lid	Thu May 24 13:09:59 2007
@@ -0,0 +1,3 @@
+library: regular-expressions-test-suite
+files: library
+       regular-expressions-test-suite



More information about the chatter mailing list