Changeset 356
- Timestamp:
- 03/06/05 02:35:48 (4 years ago)
- Files:
-
- trunk/mango/test/unittest.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/mango/test/unittest.d
r346 r356 295 295 296 296 import mango.icu.UMango, 297 mango.icu.URegex, 297 298 mango.icu.UString, 298 299 mango.icu.UDomainName, … … 309 310 310 311 //import mango.xml.dom.all; 312 313 /******************************************************************************* 314 315 Directive for build.exe to include the winsock2 library 316 317 *******************************************************************************/ 318 319 version (build) 320 { 321 version (Win32) 322 pragma (link, wsock32); 323 } 311 324 312 325 /******************************************************************************* … … 2383 2396 w.setEncoder (new StringEncoder32 ("utf8")); 2384 2397 w ("<?xml version='1.0'?>") ("<element") (' ') ("/>") (CR); 2398 } 2399 2400 /******************************************************************************* 2401 2402 check the Regex stuff is hooked up 2403 2404 *******************************************************************************/ 2405 2406 void testRegex () 2407 { 2408 wchar[] fields[10]; 2409 2410 Stdout.setEncoder (new StringEncoder16 ("utf8")); 2411 2412 URegex r = new URegex ("[0-9]+", URegex.Flag.CaseInsensitive); 2413 r.setText (new UString ("123abc456def789")); 2414 2415 for (int i = r.split(fields); i-- > 0;) 2416 { 2417 wchar[] x = fields[i]; 2418 Stdout.putw(x) (CR); 2419 } 2420 } 2421 2422 void testRegex1 () 2423 { 2424 Stdout.setEncoder (new StringEncoder16 ("utf8")); 2425 2426 URegex r = new URegex ("(1).*(abc).*(789)", URegex.Flag.CaseInsensitive); 2427 r.setText (new UString ("123abc456def789")); 2428 2429 if (r.next) 2430 with (r.groups()) 2431 { 2432 Stdout .putw(g0) (' ') .putw(g1) (' ') .putw(g2) (' ') .putw(g3) (CR); 2433 } 2385 2434 } 2386 2435 } … … 2522 2571 //testClassIO(); 2523 2572 //testConvert(); 2573 //testRegex(); 2574 //testRegex1(); 2524 2575 logger.info ("Done"); 2525 2576 } catch (Object x)
