diff options
| author | ramn <github@rymdimperiet.org> | 2023-07-08 23:46:51 +0200 |
|---|---|---|
| committer | ramn <github@rymdimperiet.org> | 2023-07-08 23:46:51 +0200 |
| commit | 7b89f258189f817bcc177bbc4426c48f3ccd9127 (patch) | |
| tree | 53dc7812d6d40a2132b2fc1563c7cfe1af035c38 /tests/issues | |
| parent | 3072479c3c3c4818b0a41dc2aed288e8b3ec0582 (diff) | |
Fix #2637
where testing.expect_value can't compare nils
Diffstat (limited to 'tests/issues')
| -rw-r--r-- | tests/issues/run.bat | 1 | ||||
| -rwxr-xr-x | tests/issues/run.sh | 1 | ||||
| -rw-r--r-- | tests/issues/test_issue_2637.odin | 13 |
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/issues/run.bat b/tests/issues/run.bat index 105d474e3..63d722e09 100644 --- a/tests/issues/run.bat +++ b/tests/issues/run.bat @@ -14,6 +14,7 @@ set COMMON=-collection:tests=..\.. ..\..\..\odin build ..\test_issue_2113.odin %COMMON% -file -debug || exit /b ..\..\..\odin test ..\test_issue_2466.odin %COMMON% -file || exit /b ..\..\..\odin test ..\test_issue_2615.odin %COMMON% -file || exit /b +..\..\..\odin test ..\test_issue_2637.odin %COMMON% -file || exit /b @echo off diff --git a/tests/issues/run.sh b/tests/issues/run.sh index c4c53e7e1..7d2101dc6 100755 --- a/tests/issues/run.sh +++ b/tests/issues/run.sh @@ -17,6 +17,7 @@ $ODIN test ../test_issue_2087.odin $COMMON -file $ODIN build ../test_issue_2113.odin $COMMON -file -debug $ODIN test ../test_issue_2466.odin $COMMON -file $ODIN test ../test_issue_2615.odin $COMMON -file +$ODIN test ../test_issue_2637.odin $COMMON -file if [[ $($ODIN build ../test_issue_2395.odin $COMMON -file 2>&1 >/dev/null | grep -c "$NO_NIL_ERR") -eq 2 ]] ; then echo "SUCCESSFUL 1/1" else diff --git a/tests/issues/test_issue_2637.odin b/tests/issues/test_issue_2637.odin new file mode 100644 index 000000000..c170fc444 --- /dev/null +++ b/tests/issues/test_issue_2637.odin @@ -0,0 +1,13 @@ +// Tests issue #2637 https://github.com/odin-lang/Odin/issues/2637 +package test_issues + +import "core:testing" + +Foo :: Maybe(string) + +@(test) +test_expect_value_succeeds_with_nil :: proc(t: ^testing.T) { + x: Foo + testing.expect(t, x == nil) // Succeeds + testing.expect_value(t, x, nil) // Fails, "expected nil, got nil" +} |