where testing.expect_value can't compare nils
This commit is contained in:
ramn
2023-07-08 23:46:51 +02:00
parent 3072479c3c
commit 7b89f25818
4 changed files with 18 additions and 2 deletions
+1
View File
@@ -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
+1
View File
@@ -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
+13
View File
@@ -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"
}