Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mindula committed May 22, 2024
1 parent 69753c0 commit 94f32c2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ public Object[] dataToTestGroupByClauseWithListCtr() {
"testGroupbyVarDefsAndSelectWithGroupingKeysFromClause1",
"testGroupByVarDefsAndSelectWithGroupingKeysWithJoinClause1",
"testGroupByVarDefsAndSelectWithGroupingKeysWithJoinClause2",
"testGroupByVarAndSelectWithNonGroupingKeysWithJoinClause1"
"testGroupByVarAndSelectWithNonGroupingKeysWithJoinClause1",
"testModuleLevelGroupBy"
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public Object[] getFuncNames() {
"testwildcardBindingPatternInLetClause",
"testQueryInLetClauseAsAClosure1",
"testQueryInLetClauseAsAClosure2",
"testQueryInLetClauseAsAClosure3"
"testQueryInLetClauseAsAClosure3",
"testModuleLevelLetClause"
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,25 @@ function assertEquality(anydata expected, anydata actual) {
panic error("expected '" + expected.toString() + "', found '" + actual.toString() + "'");
}

type Person record {|
string fname;
string lname;
int id;
|};

Person[] person = [];

var v1 = from var st in person
group by var name = st.fname + st.lname
select name;

function testModuleLevelGroupBy() {
var v2 = from var st in person
group by var name = st.fname + st.lname
select name;
var v3 = v1;
}

// TODO: Add test cases readonly types
// TODO: use a client
// TODO: xml langlib function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,21 @@ function assertEquality(any|error expected, any|error actual) {
panic error(ASSERTION_ERROR_REASON,
message = "expected '" + expectedValAsString + "', found '" + actualValAsString + "'");
}

type Student record {|
string fname;
string lname;
int id;
|};

Student[] students = [];

var v1 = from var st in students
let var name = st.fname + st.lname
select name;

function testModuleLevelLetClause() {
var v2 = from var st in students
let var name = st.fname + st.lname
select name;
}

0 comments on commit 94f32c2

Please sign in to comment.