From 293953a078f8a23601eed6cd05c71d2aa407780c Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Mon, 29 Jun 2026 22:43:08 +0200 Subject: [PATCH] tests: update with multi-parameter generics --- .../cases/checker/04_custom_types.py.ref.json | 4 +- tests/cases/checker/07_variance.py.ref.json | 2 +- .../python-parser/01_simple_types.py.ref.json | 14 +-- .../python-parser/02_custom_types.py.ref.json | 50 ++++++----- .../python-parser/03_functions.py.ref.json | 86 ++++++++++--------- 5 files changed, 85 insertions(+), 71 deletions(-) diff --git a/tests/cases/checker/04_custom_types.py.ref.json b/tests/cases/checker/04_custom_types.py.ref.json index 01177d9..5698ca2 100644 --- a/tests/cases/checker/04_custom_types.py.ref.json +++ b/tests/cases/checker/04_custom_types.py.ref.json @@ -24,7 +24,7 @@ "type": { "_type": "BaseType", "base": "Meter", - "param": null + "args": [] }, "expr": { "_type": "LiteralExpr", @@ -62,7 +62,7 @@ "type": { "_type": "BaseType", "base": "Second", - "param": null + "args": [] }, "expr": { "_type": "LiteralExpr", diff --git a/tests/cases/checker/07_variance.py.ref.json b/tests/cases/checker/07_variance.py.ref.json index a4387ee..abfebf3 100644 --- a/tests/cases/checker/07_variance.py.ref.json +++ b/tests/cases/checker/07_variance.py.ref.json @@ -317,7 +317,7 @@ "pos": 0, "name": "object", "type": {}, - "required": true + "required": false } ], "args": [], diff --git a/tests/cases/python-parser/01_simple_types.py.ref.json b/tests/cases/python-parser/01_simple_types.py.ref.json index 452b9c0..50730f3 100644 --- a/tests/cases/python-parser/01_simple_types.py.ref.json +++ b/tests/cases/python-parser/01_simple_types.py.ref.json @@ -16,7 +16,7 @@ "type": { "_type": "BaseType", "base": "bool", - "param": null + "args": [] } }, { @@ -25,7 +25,7 @@ "type": { "_type": "BaseType", "base": "int", - "param": null + "args": [] } }, { @@ -36,7 +36,7 @@ "type": { "_type": "BaseType", "base": "float", - "param": null + "args": [] }, "constraint": "(_ > 0) + (_ < 250)" } @@ -47,7 +47,7 @@ "type": { "_type": "BaseType", "base": "str", - "param": null + "args": [] } }, { @@ -56,7 +56,7 @@ "type": { "_type": "BaseType", "base": "datetime", - "param": null + "args": [] } }, { @@ -65,7 +65,7 @@ "type": { "_type": "BaseType", "base": "float", - "param": null + "args": [] } }, { @@ -79,7 +79,7 @@ "type": { "_type": "BaseType", "base": "_", - "param": null + "args": [] } } ] diff --git a/tests/cases/python-parser/02_custom_types.py.ref.json b/tests/cases/python-parser/02_custom_types.py.ref.json index 9d77ebd..fdb89d3 100644 --- a/tests/cases/python-parser/02_custom_types.py.ref.json +++ b/tests/cases/python-parser/02_custom_types.py.ref.json @@ -16,7 +16,7 @@ "type": { "_type": "BaseType", "base": "GeoLocation", - "param": null + "args": [] } } ] @@ -28,11 +28,13 @@ "type": { "_type": "BaseType", "base": "Column", - "param": { - "_type": "BaseType", - "base": "GeoLocation", - "param": null - } + "args": [ + { + "_type": "BaseType", + "base": "GeoLocation", + "args": [] + } + ] } }, { @@ -65,11 +67,13 @@ "type": { "_type": "BaseType", "base": "Column", - "param": { - "_type": "BaseType", - "base": "GeoLocation", - "param": null - } + "args": [ + { + "_type": "BaseType", + "base": "GeoLocation", + "args": [] + } + ] } }, { @@ -117,7 +121,7 @@ "type": { "_type": "BaseType", "base": "Latitude", - "param": null + "args": [] } }, { @@ -146,7 +150,7 @@ "type": { "_type": "BaseType", "base": "Latitude", - "param": null + "args": [] } }, { @@ -175,11 +179,13 @@ "type": { "_type": "BaseType", "base": "Difference", - "param": { - "_type": "BaseType", - "base": "Latitude", - "param": null - } + "args": [ + { + "_type": "BaseType", + "base": "Latitude", + "args": [] + } + ] } }, { @@ -217,7 +223,7 @@ "type": { "_type": "BaseType", "base": "int", - "param": null + "args": [] }, "constraint": "_ >= 0" } @@ -230,7 +236,7 @@ "type": { "_type": "BaseType", "base": "float", - "param": null + "args": [] }, "constraint": "_ >= 0" } @@ -252,7 +258,7 @@ "type": { "_type": "BaseType", "base": "int", - "param": null + "args": [] }, "constraint": "Positive" } @@ -265,7 +271,7 @@ "type": { "_type": "BaseType", "base": "float", - "param": null + "args": [] }, "constraint": "Positive" } diff --git a/tests/cases/python-parser/03_functions.py.ref.json b/tests/cases/python-parser/03_functions.py.ref.json index a8f261f..2288b82 100644 --- a/tests/cases/python-parser/03_functions.py.ref.json +++ b/tests/cases/python-parser/03_functions.py.ref.json @@ -14,15 +14,17 @@ "type": { "_type": "BaseType", "base": "Column", - "param": { - "_type": "ConstraintType", - "type": { - "_type": "BaseType", - "base": "float", - "param": null - }, - "constraint": "0 <= _ <= 1" - } + "args": [ + { + "_type": "ConstraintType", + "type": { + "_type": "BaseType", + "base": "float", + "args": [] + }, + "constraint": "0 <= _ <= 1" + } + ] }, "default": null }, @@ -31,15 +33,17 @@ "type": { "_type": "BaseType", "base": "Column", - "param": { - "_type": "ConstraintType", - "type": { - "_type": "BaseType", - "base": "float", - "param": null - }, - "constraint": "0 <= _ <= 1" - } + "args": [ + { + "_type": "ConstraintType", + "type": { + "_type": "BaseType", + "base": "float", + "args": [] + }, + "constraint": "0 <= _ <= 1" + } + ] }, "default": null } @@ -50,15 +54,17 @@ "returns": { "_type": "BaseType", "base": "Column", - "param": { - "_type": "ConstraintType", - "type": { - "_type": "BaseType", - "base": "float", - "param": null - }, - "constraint": "0 <= _ <= 2" - } + "args": [ + { + "_type": "ConstraintType", + "type": { + "_type": "BaseType", + "base": "float", + "args": [] + }, + "constraint": "0 <= _ <= 2" + } + ] }, "body": [ { @@ -67,15 +73,17 @@ "type": { "_type": "BaseType", "base": "Column", - "param": { - "_type": "ConstraintType", - "type": { - "_type": "BaseType", - "base": "float", - "param": null - }, - "constraint": "0 <= _ <= 2" - } + "args": [ + { + "_type": "ConstraintType", + "type": { + "_type": "BaseType", + "base": "float", + "args": [] + }, + "constraint": "0 <= _ <= 2" + } + ] } }, { @@ -117,7 +125,7 @@ "type": { "_type": "BaseType", "base": "int", - "param": null + "args": [] }, "default": null } @@ -128,7 +136,7 @@ "type": { "_type": "BaseType", "base": "float", - "param": null + "args": [] }, "default": null } @@ -140,7 +148,7 @@ "type": { "_type": "BaseType", "base": "str", - "param": null + "args": [] }, "default": null }