Skip to content

Commit

Permalink
Fix new Set() and new Interval()
Browse files Browse the repository at this point in the history
  • Loading branch information
5pilow committed Oct 1, 2023
1 parent 879cb17 commit 8a15ef7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/leekscript/runner/AI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3123,6 +3123,14 @@ public MapLeekValue new_mapClass() {
return new MapLeekValue(this);
}

public SetLeekValue new_setClass() throws LeekRunException {
return new SetLeekValue(this);
}

public IntervalLeekValue new_intervalClass() throws LeekRunException {
return new RealIntervalLeekValue(this);
}

public ObjectLeekValue new_objectClass() {
return new ObjectLeekValue(this, this.objectClass);
}
Expand Down
1 change: 1 addition & 0 deletions src/test/java/test/TestInterval.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void run() throws Exception {
code_v1("return [1.0 ..[").equals("[1..∞[");
code_v2_("return [1.0 ..[").equals("[1.0..∞[");
code("[1..2]").ops(2);
code_v3_("Interval a = new Interval() return a").equals("[..]");

section("Interval.intervalMin");
code("return intervalMin([1..2])").equals("1");
Expand Down
1 change: 1 addition & 0 deletions src/test/java/test/TestSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public void run() throws Exception {
code("return <>").equals("<>");
DISABLED_code("return <<>>").equals("<<>>");
code("<1, 2, 3, 4>").ops(8);
code_v3_("Set<integer> a = new Set() return a").equals("<>");

section("Set typing");
code_strict_v4_("Set i = <1, 2>; return i instanceof Set").equals("true");
Expand Down

0 comments on commit 8a15ef7

Please sign in to comment.