diff --git a/Tests/GoldLibrary.Tests.Shared.projitems b/Tests/GoldLibrary.Tests.Shared.projitems index e2ab4a2..e20175e 100644 --- a/Tests/GoldLibrary.Tests.Shared.projitems +++ b/Tests/GoldLibrary.Tests.Shared.projitems @@ -36,5 +36,7 @@ + + \ No newline at end of file diff --git a/Tests/RegexTests.go b/Tests/RegexTests.go new file mode 100644 index 0000000..ab94eaa --- /dev/null +++ b/Tests/RegexTests.go @@ -0,0 +1,17 @@ +package GoldLibrary.Tests.Shared +import ( + "bytes" + "fmt" + "regexp" +) + + +func DoSimpleMatchTest() bool { + matched, _ := regexp.MatchString("foo.*", "seafood") + return matched +} + +func DoMustCompileTest() bool { + var validID = regexp.MustCompile(`^[a-z]+\[[0-9]+\]$`) + return validID.MatchString("adam[23]") +} \ No newline at end of file diff --git a/Tests/RegexTests.pas b/Tests/RegexTests.pas new file mode 100644 index 0000000..b71314d --- /dev/null +++ b/Tests/RegexTests.pas @@ -0,0 +1,24 @@ +namespace GoldLibrary.Tests.Shared; + +uses + RemObjects.Elements.EUnit, + RemObjects.Elements.RTL; + +type + RegeexTests = public class(Test) + + public + method SimpleMatchTest; + begin + Assert.IsTrue(TestApplication2.DoSimpleMatchTest()); + end; + + + method MustCompileTest; + begin + Assert.IsTrue(TestApplication2.DoMustCompileTest()); + end; + + end; + +end. \ No newline at end of file