-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: by default, don't generate code for runner integration (#905)
Closes #900 ### Summary of Changes * We now have only a few targeted generator tests for the runner integration, instead of having this scattered across almost all tests. * Use vitest's `toMatchFileSnapshot` to easily be able to update the expected output after changes to the code generator. Run `vitest --update` to do so.
- Loading branch information
1 parent
5630a9f
commit 048d9cf
Showing
166 changed files
with
608 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 0 additions & 24 deletions
24
packages/safe-ds-lang/tests/resources/generation/eject/input.sdstest
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...fe-ds-lang/tests/resources/generation/eject/output/tests/generator/eject/gen_input.py.map
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
.../expressions/block lambda result/generated/tests/generator/blockLambdaResult/gen_input.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Segments --------------------------------------------------------------------- | ||
|
||
def f1(l): | ||
h(l(1, 2)) | ||
|
||
def f2(l): | ||
h(l(1, 2)[1]) | ||
h(l(1, 2)[0]) | ||
|
||
# Pipelines -------------------------------------------------------------------- | ||
|
||
def test(): | ||
def __gen_block_lambda_0(a, b): | ||
__gen_block_lambda_result_d = g() | ||
return __gen_block_lambda_result_d | ||
f1(__gen_block_lambda_0) | ||
def __gen_block_lambda_1(a, b): | ||
__gen_block_lambda_result_d = g() | ||
__gen_block_lambda_result_e = g() | ||
return __gen_block_lambda_result_d, __gen_block_lambda_result_e | ||
f2(__gen_block_lambda_1) |
1 change: 1 addition & 0 deletions
1
...ressions/block lambda result/generated/tests/generator/blockLambdaResult/gen_input.py.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
25 changes: 0 additions & 25 deletions
25
...ion/expressions/block lambda result/output/tests/generator/blockLambdaResult/gen_input.py
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...expressions/block lambda result/output/tests/generator/blockLambdaResult/gen_input.py.map
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
...es/generation/expressions/block lambda/generated/tests/generator/blockLambda/gen_input.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Pipelines -------------------------------------------------------------------- | ||
|
||
def test(): | ||
def __gen_block_lambda_0(a, b=2): | ||
__gen_block_lambda_result_d = g() | ||
return __gen_block_lambda_result_d | ||
f1(__gen_block_lambda_0) | ||
def __gen_block_lambda_1(a, b): | ||
__gen_block_lambda_result_d = g() | ||
return __gen_block_lambda_result_d | ||
f1(__gen_block_lambda_1) | ||
def __gen_block_lambda_2(): | ||
pass | ||
f2(__gen_block_lambda_2) | ||
def __gen_block_lambda_3(a, b=2): | ||
__gen_block_lambda_result_d = g() | ||
return __gen_block_lambda_result_d | ||
g2(f3(__gen_block_lambda_3)) | ||
def __gen_block_lambda_4(a, b=2): | ||
__gen_block_lambda_result_d = g() | ||
return __gen_block_lambda_result_d | ||
c = f3(__gen_block_lambda_4) | ||
g2(c) |
1 change: 1 addition & 0 deletions
1
...eneration/expressions/block lambda/generated/tests/generator/blockLambda/gen_input.py.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
28 changes: 0 additions & 28 deletions
28
...urces/generation/expressions/block lambda/output/tests/generator/blockLambda/gen_input.py
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...s/generation/expressions/block lambda/output/tests/generator/blockLambda/gen_input.py.map
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
...g/tests/resources/generation/expressions/call/generated/tests/generator/call/gen_input.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Imports ---------------------------------------------------------------------- | ||
|
||
from typing import Any, Callable, TypeVar | ||
|
||
# Type variables --------------------------------------------------------------- | ||
|
||
__gen_T = TypeVar("__gen_T") | ||
|
||
# Utils ------------------------------------------------------------------------ | ||
|
||
def __gen_null_safe_call(receiver: Any, callable: Callable[[], __gen_T]) -> __gen_T | None: | ||
return callable() if receiver is not None else None | ||
|
||
# Pipelines -------------------------------------------------------------------- | ||
|
||
def test(): | ||
f(g(1, param2=2)) | ||
f(g(2, param2=1)) | ||
f(h(1, param_2=2)) | ||
f(h(2, param_2=1)) | ||
f(h(2)) | ||
'abc'.i() | ||
'abc'.j(123) | ||
k(456, 1.23) | ||
__gen_null_safe_call(f, lambda: f(g(1, param2=2))) | ||
__gen_null_safe_call(f, lambda: f(g(2, param2=1))) | ||
__gen_null_safe_call(f, lambda: f(h(1, param_2=2))) | ||
__gen_null_safe_call(f, lambda: f(h(2, param_2=1))) | ||
__gen_null_safe_call(f, lambda: f(h(2))) | ||
__gen_null_safe_call(i, lambda: 'abc'.i()) | ||
__gen_null_safe_call(j, lambda: 'abc'.j(123)) | ||
__gen_null_safe_call(k, lambda: k(456, 1.23)) |
1 change: 1 addition & 0 deletions
1
...sts/resources/generation/expressions/call/generated/tests/generator/call/gen_input.py.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.