Skip to content

Commit

Permalink
Testcase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarfland committed Jun 18, 2024
1 parent 71dc0d2 commit f127232
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
1 change: 1 addition & 0 deletions Test/Elements.RTL2.Tests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 27,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Diff.pas" />
<Compile Include="$(MSBuildThisFileDirectory)Json.pas" />
<Compile Include="$(MSBuildThisFileDirectory)Strings.Formatter.pas" />
<Compile Include="$(MSBuildThisFileDirectory)Variables.pas" />
</ItemGroup>
</Project>
11 changes: 1 addition & 10 deletions Test/Timer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 8,12 @@
// For OS X and iOS an NSRunLoop is needed
type
TimerTests = public class(Test)
private
protected
public

method TestBasicTimer;
begin
var lTest := 0;
var lTimer := new RemObjects.Elements.RTL.Timer(100, (aData) -> begin inc(lTest, 1); end);
//lTimer.Elapsed := (aData) -> begin
//inc(lTest, 1);
//end;
lTimer.Start;
Thread.Sleep(350);
lTimer.Stop;
Expand All @@ -28,11 24,6 @@
begin
var lTest := 0;
var lTimer := new RemObjects.Elements.RTL.Timer(100, false, (aData) -> begin inc(lTest, 1); end);

//lTimer.Repeat := false;
//lTimer.Elapsed := (aData) -> begin
//inc(lTest, 1);
//end;
lTimer.Start;
Thread.Sleep(500);
lTimer.Stop;
Expand Down
29 changes: 29 additions & 0 deletions Test/Variables.pas
Original file line number Diff line number Diff line change
@@ -0,0 1,29 @@
namespace Elements.RTL2.Tests.Shared;

uses
RemObjects.Elements.EUnit,
RemObjects.Elements.RTL;

type
Variables = public class(Test)
private
protected
public

method TestEBuildVariables;
begin

var d := new Dictionary<String,String>;
d["test"] := "_test_";
d["foo"] := "_foo_";

Check.AreEqual("hello $(test) this is $(foo)".ProcessVariables(VariableStyle.EBuild, d), "hello _test_ this is _foo_");
Check.AreEqual("hello $$(test) this is $(foo)".ProcessVariables(VariableStyle.EBuild, d), "hello $(test) this is _foo_");
Check.AreEqual("hello $$$(test) this is $(foo)".ProcessVariables(VariableStyle.EBuild, d), "hello $$(test) this is _foo_");

/*~!code!~*/
end;

end;

end.
3 changes: 2 additions & 1 deletion Test/Xml.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 18,8 @@
Check.IsNotNil(xml.Root.FirstElementWithName("two"));
Check.IsNotNil(xml.Root.FirstElementWithName("three"));
Check.IsNotNil(xml.Root.FirstElementWithName("a:two"));
Check.IsNotNil(xml.Root.FirstElementWithName("b:three")); Check.IsNotNil(xml.Root.FirstElementWithName("{http://bc}three"));
Check.IsNotNil(xml.Root.FirstElementWithName("b:three"));
Check.IsNotNil(xml.Root.FirstElementWithName("{http://bc}three"));

Check.IsNotNil(xml.Root.FirstElementWithName("two").FirstElementWithName("nested"));
Check.AreEqual(xml.Root.FirstElementWithName("two").FirstElementWithName("nested").Attribute["x"].Value, "a");
Expand Down

0 comments on commit f127232

Please sign in to comment.