Skip to content

Commit

Permalink
Merge pull request #3730 from AndrejMitrovic/fix-assert
Browse files Browse the repository at this point in the history
Avoid strict equality check on assert message
  • Loading branch information
DmitryOlshansky committed Oct 19, 2015
2 parents e23ec60 + 710e05d commit e7eb322
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions std/bitmanip.d
Expand Up @@ -586,6 +586,7 @@ unittest
// Issue 12477
unittest
{
import std.algorithm : canFind;
import std.bitmanip : bitfields;
import core.exception : AssertError;

Expand All @@ -600,11 +601,11 @@ unittest

try { s.a = uint.max; assert(0); }
catch (AssertError ae)
{ assert(ae.msg == "Value is greater than the maximum value of bitfield 'a'", ae.msg); }
{ assert(ae.msg.canFind("Value is greater than the maximum value of bitfield 'a'"), ae.msg); }

try { s.b = int.min; assert(0); }
catch (AssertError ae)
{ assert(ae.msg == "Value is smaller than the minimum value of bitfield 'b'", ae.msg); }
{ assert(ae.msg.canFind("Value is smaller than the minimum value of bitfield 'b'"), ae.msg); }
}

/**
Expand Down

0 comments on commit e7eb322

Please sign in to comment.