Skip to content

Commit 6df30d3

Browse files
committed
Fixup test-with-real-projects, 8.5 fixes
1 parent cf404b5 commit 6df30d3

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

bin/ci/test-with-real-projects.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ set -x
66
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
77
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
88
PSALM="$(readlink -f "$SCRIPT_DIR/../../psalm")"
9-
PSALM_PHAR="$(readlink -f "$SCRIPT_DIR/../../build/psalm.phar")"
9+
PSALM_PHAR="$(readlink -f "$SCRIPT_DIR/../../build/psalm.phar" || echo "")"
1010

1111
if [ ! -f "$PSALM_PHAR" ]; then PSALM_PHAR="$PSALM"; fi
1212

13+
which gsed > /dev/null && sed=gsed || sed=sed
14+
1315
rm -Rf /tmp/testing-with-real-projects
1416
mkdir -p /tmp/testing-with-real-projects
1517
cd /tmp/testing-with-real-projects
@@ -54,7 +56,7 @@ psl)
5456
composer install --ignore-platform-reqs
5557
# Avoid conflicts with old psalm when running phar tests
5658
rm -rf vendor/vimeo/psalm
57-
sed 's/ErrorOutputBehavior::Packed, ErrorOutputBehavior::Discard/ErrorOutputBehavior::Discard/g' -i src/Psl/Shell/execute.php
59+
$sed 's/ErrorOutputBehavior::Packed, ErrorOutputBehavior::Discard/ErrorOutputBehavior::Discard/g' -i src/Psl/Shell/execute.php
5860
"$PSALM_PHAR" --monochrome -c config/psalm.xml --set-baseline=psalm-baseline.xml || FAIL=$?
5961
"$PSALM_PHAR" --monochrome -c config/psalm-static-analysis.xml tests/static-analysis --set-baseline=psalm-baseline-static-analysis.xml || FAIL=$?
6062
;;

src/Psalm/Type/Atomic/TLiteralFloat.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public function __construct(public float $value, bool $from_docblock = false)
2121
#[Override]
2222
public function getKey(bool $include_extra = true): string
2323
{
24+
if (is_nan($this->value)) {
25+
return 'float(NAN)';
26+
}
2427
return 'float(' . $this->value . ')';
2528
}
2629

0 commit comments

Comments
 (0)