From 54919a356526b4ccf80f5d81bd9c53d9e7cfa170 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sat, 13 Jun 2026 18:01:32 +0200 Subject: [PATCH] tests: update with newly reported judgements --- tests/cases/checker/03_functions.py.ref.json | 13 ++ .../cases/checker/05_control_flow.py.ref.json | 194 ++++++++++++++++++ tests/cases/checker/06_subtyping.py.ref.json | 47 +++++ 3 files changed, 254 insertions(+) diff --git a/tests/cases/checker/03_functions.py.ref.json b/tests/cases/checker/03_functions.py.ref.json index 756a143..814bc35 100644 --- a/tests/cases/checker/03_functions.py.ref.json +++ b/tests/cases/checker/03_functions.py.ref.json @@ -254,6 +254,19 @@ } ], "judgments": [ + { + "location": { + "from": "L2:11", + "to": "L2:15" + }, + "expr": { + "_type": "LiteralExpr", + "value": true + }, + "type": { + "name": "bool" + } + }, { "location": { "from": "L5:5", diff --git a/tests/cases/checker/05_control_flow.py.ref.json b/tests/cases/checker/05_control_flow.py.ref.json index 8f031f2..be86030 100644 --- a/tests/cases/checker/05_control_flow.py.ref.json +++ b/tests/cases/checker/05_control_flow.py.ref.json @@ -70,6 +70,27 @@ "name": "int" } }, + { + "location": { + "from": "L2:11", + "to": "L2:16" + }, + "expr": { + "_type": "BinaryExpr", + "left": { + "_type": "VariableExpr", + "name": "a" + }, + "operator": "+", + "right": { + "_type": "VariableExpr", + "name": "b" + } + }, + "type": { + "name": "int" + } + }, { "location": { "from": "L5:7", @@ -96,6 +117,27 @@ "name": "int" } }, + { + "location": { + "from": "L5:7", + "to": "L5:12" + }, + "expr": { + "_type": "CompareExpr", + "left": { + "_type": "VariableExpr", + "name": "a" + }, + "operator": "<", + "right": { + "_type": "VariableExpr", + "name": "b" + } + }, + "type": { + "name": "bool" + } + }, { "location": { "from": "L6:15", @@ -122,6 +164,27 @@ "name": "int" } }, + { + "location": { + "from": "L6:15", + "to": "L6:20" + }, + "expr": { + "_type": "BinaryExpr", + "left": { + "_type": "VariableExpr", + "name": "b" + }, + "operator": "-", + "right": { + "_type": "VariableExpr", + "name": "a" + } + }, + "type": { + "name": "int" + } + }, { "location": { "from": "L8:15", @@ -148,6 +211,27 @@ "name": "int" } }, + { + "location": { + "from": "L8:15", + "to": "L8:20" + }, + "expr": { + "_type": "BinaryExpr", + "left": { + "_type": "VariableExpr", + "name": "a" + }, + "operator": "-", + "right": { + "_type": "VariableExpr", + "name": "b" + } + }, + "type": { + "name": "int" + } + }, { "location": { "from": "L15:7", @@ -174,6 +258,27 @@ "name": "int" } }, + { + "location": { + "from": "L15:7", + "to": "L15:13" + }, + "expr": { + "_type": "CompareExpr", + "left": { + "_type": "VariableExpr", + "name": "a" + }, + "operator": ">", + "right": { + "_type": "LiteralExpr", + "value": 10 + } + }, + "type": { + "name": "bool" + } + }, { "location": { "from": "L16:15", @@ -200,6 +305,40 @@ "name": "int" } }, + { + "location": { + "from": "L16:15", + "to": "L16:21" + }, + "expr": { + "_type": "BinaryExpr", + "left": { + "_type": "VariableExpr", + "name": "a" + }, + "operator": "-", + "right": { + "_type": "LiteralExpr", + "value": 10 + } + }, + "type": { + "name": "int" + } + }, + { + "location": { + "from": "L18:15", + "to": "L18:16" + }, + "expr": { + "_type": "VariableExpr", + "name": "a" + }, + "type": { + "name": "int" + } + }, { "location": { "from": "L22:7", @@ -226,6 +365,27 @@ "name": "int" } }, + { + "location": { + "from": "L22:7", + "to": "L22:12" + }, + "expr": { + "_type": "CompareExpr", + "left": { + "_type": "VariableExpr", + "name": "a" + }, + "operator": "<", + "right": { + "_type": "VariableExpr", + "name": "b" + } + }, + "type": { + "name": "bool" + } + }, { "location": { "from": "L23:15", @@ -251,6 +411,40 @@ "type": { "name": "int" } + }, + { + "location": { + "from": "L23:15", + "to": "L23:20" + }, + "expr": { + "_type": "BinaryExpr", + "left": { + "_type": "VariableExpr", + "name": "b" + }, + "operator": "-", + "right": { + "_type": "VariableExpr", + "name": "a" + } + }, + "type": { + "name": "int" + } + }, + { + "location": { + "from": "L25:15", + "to": "L25:21" + }, + "expr": { + "_type": "LiteralExpr", + "value": "oops" + }, + "type": { + "name": "str" + } } ] } \ No newline at end of file diff --git a/tests/cases/checker/06_subtyping.py.ref.json b/tests/cases/checker/06_subtyping.py.ref.json index 0659939..3435f45 100644 --- a/tests/cases/checker/06_subtyping.py.ref.json +++ b/tests/cases/checker/06_subtyping.py.ref.json @@ -53,6 +53,53 @@ "name": "float" } }, + { + "location": { + "from": "L6:7", + "to": "L6:12" + }, + "expr": { + "_type": "CompareExpr", + "left": { + "_type": "VariableExpr", + "name": "b" + }, + "operator": ">", + "right": { + "_type": "VariableExpr", + "name": "a" + } + }, + "type": { + "name": "bool" + } + }, + { + "location": { + "from": "L7:15", + "to": "L7:16" + }, + "expr": { + "_type": "VariableExpr", + "name": "b" + }, + "type": { + "name": "float" + } + }, + { + "location": { + "from": "L8:11", + "to": "L8:12" + }, + "expr": { + "_type": "VariableExpr", + "name": "a" + }, + "type": { + "name": "float" + } + }, { "location": { "from": "L11:5",