Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Tests/GoldLibrary.Tests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@
<Compile Include="$(MSBuildThisFileDirectory)ImageTests.go" />
<Compile Include="$(MSBuildThisFileDirectory)MimeTests.pas" />
<Compile Include="$(MSBuildThisFileDirectory)MimeTEsts.go" />
<Compile Include="$(MSBuildThisFileDirectory)RegexTests.go" />
<Compile Include="$(MSBuildThisFileDirectory)RegexTests.pas" />
</ItemGroup>
</Project>
17 changes: 17 additions & 0 deletions Tests/RegexTests.go
Original file line number Diff line number Diff line change
@@ -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]")
}
24 changes: 24 additions & 0 deletions Tests/RegexTests.pas
Original file line number Diff line number Diff line change
@@ -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.