Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 1558

Show
Ignore:
Timestamp:
05/26/10 06:00:04 (15 years ago)
Author:
rsinfu
Message:

Fixed unittest failure in regex and regexp.

Recent druntime embeds backtrace information in Exception.toString(). So the actual error message will not be identical to the argument passed to error().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/phobos/std/regex.d

    r1545 r1558  
    282282        try 
    283283        { 
    284284            auto r2 = Regex("hello", "q"); 
    285285            assert(0); 
    286286        } 
    287287        catch (Exception ree) 
    288288        { 
    289289            msg = ree.toString(); 
    290290            //writefln("message: %s", ree); 
    291291        } 
    292         assert(msg == "object.Exception: unrecognized attribute"); 
     292        assert(indexOf(msg, "unrecognized attribute") >= 0); 
    293293    } 
    294294 
    295295/** 
    296296Returns the number of parenthesized captures 
    297297*/ 
    298298    uint captures() const 
    299299    { 
    300300        return re_nsub; 
    301301    } 
    302302 
  • trunk/phobos/std/regexp.d

    r1519 r1558  
    669669        try 
    670670        { 
    671671            auto r2 = RegExp("hello", "q"); 
    672672            assert(0); 
    673673        } 
    674674        catch (RegExpException ree) 
    675675        { 
    676676            msg = ree.toString(); 
    677677            //writefln("message: %s", ree); 
    678678        } 
    679         assert(msg == "std.regexp.RegExpException: unrecognized attribute"); 
     679        assert(indexOf(msg, "unrecognized attribute") >= 0); 
    680680    } 
    681681 
    682682    /************************************ 
    683683     * Set up for start of foreach loop. 
    684684     * Returns: 
    685685     *  search() returns instance of RegExp set up to _search string[]. 
    686686     * Example: 
    687687     * --- 
    688688     * import std.stdio; 
    689689     * import std.regexp;