Skip to content

Commit b542cd3

Browse files
authored
Tests: improve Windows compatibility (#93)
1 parent 2a10abb commit b542cd3

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎features/eval.feature‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,13 @@ Feature: Evaluating PHP code and files.
178178
echo __FILE__;
179179
"""
180180

181-
When I run `wp eval-file script.php --skip-wordpress`
181+
When I run `wp eval "echo DIRECTORY_SEPARATOR;" --skip-wordpress`
182+
And save STDOUT as {DIRECTORY_SEPARATOR}
183+
184+
And I run `wp eval-file script.php --skip-wordpress`
182185
Then STDOUT should contain:
183186
"""
184-
/script.php
187+
{DIRECTORY_SEPARATOR}script.php
185188
"""
186189
And STDOUT should not contain:
187190
"""
@@ -226,14 +229,17 @@ Feature: Evaluating PHP code and files.
226229
echo ' __FILE__ => ' . __FILE__;
227230
"""
228231

229-
When I run `wp eval-file script.php --skip-wordpress`
232+
When I run `wp eval "echo DIRECTORY_SEPARATOR;" --skip-wordpress`
233+
And save STDOUT as {DIRECTORY_SEPARATOR}
234+
235+
And I run `wp eval-file script.php --skip-wordpress`
230236
Then STDOUT should contain:
231237
"""
232238
__FILE__ =>
233239
"""
234240
And STDOUT should contain:
235241
"""
236-
/script.php
242+
{DIRECTORY_SEPARATOR}script.php
237243
"""
238244
And STDOUT should not contain:
239245
"""
@@ -250,7 +256,7 @@ Feature: Evaluating PHP code and files.
250256
And a dir_script.php file:
251257
"""
252258
<?php
253-
echo __DIR__ . '/script.php' . PHP_EOL;
259+
echo __DIR__ . DIRECTORY_SEPARATOR . 'script.php' . PHP_EOL;
254260
"""
255261
And I run `wp eval-file script.php --skip-wordpress`
256262
And save STDOUT as {FILE_OUTPUT}

0 commit comments

Comments
 (0)