Test case for the [NSRegularExpression pattern] bug

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39961 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Niels Grewe 2016-07-06 14:59:08 +00:00
parent 62b2fb95b8
commit dfe7feebf2
2 changed files with 13 additions and 0 deletions

View file

@ -73,6 +73,14 @@ int main()
test_NSCopying(@"NSRegularExpression",@"NSRegularExpression",
[NSArray arrayWithObject:testObj],NO,NO);
NSAutoreleasePool *iPool = [NSAutoreleasePool new];
{
PASS_EQUAL([testObj pattern], @"^a", "Correct pattern returned");
}
DESTROY(iPool);
/* Regression test: We had a double-free bug on retrieving pattern,
* which is also the reason for wrapping the previous one in an ARP */
PASS_RUNS([testObj pattern], "Calling -pattern twice runs");
/* To test whether we correctly bail out of processing degenerate patterns,
* we spin up a new thread and evaluate an expression there. The expectation