Changeset 356

Show
Ignore:
Timestamp:
03/06/05 02:35:48 (4 years ago)
Author:
kris
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mango/test/unittest.d

    r346 r356  
    295295 
    296296import  mango.icu.UMango, 
     297        mango.icu.URegex, 
    297298        mango.icu.UString, 
    298299        mango.icu.UDomainName, 
     
    309310 
    310311//import    mango.xml.dom.all; 
     312 
     313/******************************************************************************* 
     314 
     315        Directive for build.exe to include the winsock2 library 
     316 
     317*******************************************************************************/ 
     318 
     319version (build) 
     320        { 
     321        version (Win32) 
     322                 pragma (link, wsock32); 
     323        } 
    311324 
    312325/******************************************************************************* 
     
    23832396        w.setEncoder (new StringEncoder32 ("utf8")); 
    23842397        w ("<?xml version='1.0'?>") ("<element") (' ') ("/>") (CR); 
     2398} 
     2399 
     2400/******************************************************************************* 
     2401 
     2402        check the Regex stuff is hooked up 
     2403 
     2404*******************************************************************************/ 
     2405 
     2406void 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 
     2422void 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                 } 
    23852434} 
    23862435} 
     
    25222571            //testClassIO(); 
    25232572            //testConvert(); 
     2573            //testRegex(); 
     2574            //testRegex1(); 
    25242575            logger.info ("Done"); 
    25252576            } catch (Object x)