Skip to content

Commit f8a61ba

Browse files
committed
test: ignore line endings
1 parent b415615 commit f8a61ba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/process/tests/GenericProcessExecutorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function test_run_string(): void
2121
$executor = new GenericProcessExecutor();
2222
$result = $executor->run('echo "hello world"');
2323

24-
$this->assertSame("hello world\n", $result->output);
24+
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $result->output);
2525
$this->assertSame('', $result->errorOutput);
2626
$this->assertSame(0, $result->exitCode);
2727
}
@@ -31,7 +31,7 @@ public function test_run(): void
3131
$executor = new GenericProcessExecutor();
3232
$result = $executor->run(new PendingProcess('echo "hello world"'));
3333

34-
$this->assertSame("hello world\n", $result->output);
34+
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $result->output);
3535
$this->assertSame('', $result->errorOutput);
3636
$this->assertSame(0, $result->exitCode);
3737
}
@@ -53,7 +53,7 @@ public function test_start(): void
5353
$this->assertSame("hello world\n", $process->output);
5454
$this->assertSame('', $process->errorOutput);
5555

56-
$this->assertSame("hello world\n", $result->output);
56+
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $result->output);
5757
$this->assertSame('', $result->errorOutput);
5858
$this->assertSame(0, $result->exitCode);
5959
}
@@ -71,7 +71,7 @@ public function test_wait_callback(): void
7171

7272
$this->assertCount(1, $output);
7373
$this->assertArrayHasKey(OutputChannel::OUTPUT->value, $output);
74-
$this->assertContains("hello world\n", $output[OutputChannel::OUTPUT->value]);
74+
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $output[OutputChannel::OUTPUT->value][0]);
7575
}
7676

7777
public function test_run_timeout(): void
@@ -110,7 +110,7 @@ public function test_run_with_error_output(): void
110110
$result = $executor->run('echo hello >&2');
111111

112112
$this->assertSame('', $result->output);
113-
$this->assertSame("hello\n", $result->errorOutput);
113+
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $result->errorOutput);
114114
$this->assertSame(0, $result->exitCode);
115115
}
116116

@@ -133,7 +133,7 @@ public function test_run_with_env(): void
133133
$executor = new GenericProcessExecutor();
134134
$result = $executor->run(new PendingProcess('echo $TEST_ENV', environment: ['TEST_ENV' => 'hello world']));
135135

136-
$this->assertSame("hello world\n", $result->output);
136+
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $result->output);
137137
$this->assertSame('', $result->errorOutput);
138138
$this->assertSame(0, $result->exitCode);
139139
}

0 commit comments

Comments
 (0)