-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
936001f
commit 9634577
Showing
25 changed files
with
279 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using NUnit.Framework; | ||
using PCRE.Support; | ||
|
||
namespace PCRE.Tests.PcreNet.Support | ||
{ | ||
[TestFixture] | ||
public class RegexKeyTests | ||
{ | ||
[Test] | ||
public void should_freeze_settings() | ||
{ | ||
var settings = new PcreRegexSettings(); | ||
Assert.That(settings.ReadOnlySettings, Is.False); | ||
|
||
var key = new RegexKey("test", settings); | ||
Assert.That(key.Settings.ReadOnlySettings, Is.True); | ||
Assert.That(settings.ReadOnlySettings, Is.False); | ||
} | ||
|
||
[Test] | ||
public void should_compare_equal() | ||
{ | ||
var implicitDefaults = new PcreRegexSettings(); | ||
var explicitDefaults = new PcreRegexSettings | ||
{ | ||
NewLine = PcreBuildInfo.NewLine, | ||
BackslashR = PcreBuildInfo.BackslashR, | ||
ParensLimit = PcreBuildInfo.ParensLimit | ||
}; | ||
|
||
var keyA = new RegexKey("test", implicitDefaults); | ||
var keyB = new RegexKey("test", explicitDefaults); | ||
|
||
Assert.That(keyA, Is.EqualTo(keyB)); | ||
} | ||
|
||
[Test] | ||
public void should_not_compare_equal() | ||
{ | ||
var defaults = new PcreRegexSettings(); | ||
var other = new PcreRegexSettings | ||
{ | ||
ParensLimit = 42 | ||
}; | ||
|
||
var keyA = new RegexKey("test", defaults); | ||
var keyB = new RegexKey("test", other); | ||
|
||
Assert.That(keyA, Is.Not.EqualTo(keyB)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using PCRE.Wrapper; | ||
|
||
namespace PCRE | ||
{ | ||
public enum PcreBackslashR | ||
{ | ||
Default = 0, | ||
Unicode = BackslashR.Unicode, | ||
AnyCrLf = BackslashR.AnyCrLf | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.