From b5719ee20b201f1cb61d21494c39c86a7d983fbd Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 23 Feb 2024 22:08:26 +0000 Subject: [PATCH] Added failing tests for literal comparisons --- test/Psalm/TypeComparatorTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/Psalm/TypeComparatorTest.php b/test/Psalm/TypeComparatorTest.php index 7a4989e..3ed1dd4 100644 --- a/test/Psalm/TypeComparatorTest.php +++ b/test/Psalm/TypeComparatorTest.php @@ -241,6 +241,10 @@ public static function isContainedByFalseProvider(): array new TFloat(), new TLiteralFloat(1.23), ], + 'literal float contained by literal float' => [ + new TLiteralFloat(1.23), + new TLiteralFloat(4.56), + ], 'int contained by literal float' => [ new TInt(), new TLiteralFloat(1.23), @@ -249,6 +253,10 @@ public static function isContainedByFalseProvider(): array new TInt(), new TLiteralInt(123), ], + 'literal int contained by literal int' => [ + new TLiteralInt(123), + new TLiteralInt(456), + ], 'string contained by literal string' => [ new TString(), TypeUtil::getAtomicStringFromLiteral('abc'), @@ -269,6 +277,10 @@ public static function isContainedByFalseProvider(): array TypeUtil::getAtomicStringFromLiteral('abc'), new TNumericString(), ], + 'zero literal string contained by literal string' => [ + TypeUtil::getAtomicStringFromLiteral('0'), + TypeUtil::getAtomicStringFromLiteral(' '), + ], 'string contained by non empty string' => [ new TString(), new TNonEmptyString(),