Skip to content

Commit

Permalink
修改测试 x.0 为有效地浮点数
Browse files Browse the repository at this point in the history
  • Loading branch information
Eno-CN authored Jul 20, 2024
1 parent dc87687 commit 867f97e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/unit/Component/Tests/ValidatorHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testDecimal(): void
Assert::assertFalse(ValidatorHelper::decimal('1'));
Assert::assertTrue(ValidatorHelper::decimal('1.1'));

Assert::assertFalse(ValidatorHelper::decimal(1.0)); // x.0 不是有效地浮点数,强转字符串将变为整数
Assert::assertTrue(ValidatorHelper::decimal(1.0));
Assert::assertTrue(ValidatorHelper::decimal('1.0'));

Assert::assertFalse(ValidatorHelper::decimal(1.25, 2));
Expand Down

0 comments on commit 867f97e

Please sign in to comment.