Skip to content

Commit

Permalink
Added failing tests for literal comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
matt committed Feb 23, 2024
1 parent 6e2efea commit b5719ee
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/Psalm/TypeComparatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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'),
Expand All @@ -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(),
Expand Down

0 comments on commit b5719ee

Please sign in to comment.