-
Notifications
You must be signed in to change notification settings - Fork 60
Tests: improve Windows compatibility #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,7 @@ Feature: Generate a POT file of a WordPress project | |
| Plugin Description | ||
| """ | ||
|
|
||
| @skip-windows | ||
| Scenario: Adds copyright comments | ||
| When I run `wp scaffold plugin hello-world` | ||
| And I run `date +"%Y"` | ||
|
|
@@ -112,6 +113,20 @@ Feature: Generate a POT file of a WordPress project | |
| # This file is distributed under the same license as the Hello World plugin. | ||
| """ | ||
|
|
||
| @require-windows | ||
| Scenario: Adds copyright comments | ||
| When I run `wp scaffold plugin hello-world` | ||
|
Comment on lines
+116
to
+118
|
||
| And I run `get-date -f yyyy` | ||
| Then STDOUT should not be empty | ||
| And save STDOUT as {YEAR} | ||
|
Comment on lines
102
to
+121
|
||
|
|
||
| When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot` | ||
| Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain: | ||
| """ | ||
| # Copyright (C) {YEAR} YOUR NAME HERE | ||
| # This file is distributed under the same license as the Hello World plugin. | ||
| """ | ||
|
|
||
| Scenario: Use the same license as the plugin | ||
| Given an empty foo-plugin directory | ||
| And a foo-plugin/foo-plugin.php file: | ||
|
|
@@ -1692,6 +1707,8 @@ Feature: Generate a POT file of a WordPress project | |
| msgid "Hello World JS" | ||
| """ | ||
|
|
||
| # Because of the date command usage. | ||
| @skip-windows | ||
| Scenario: Uses newer file headers when merging translations | ||
| Given an empty foo-plugin directory | ||
| And a foo-plugin/foo-plugin.pot file: | ||
|
|
@@ -2637,7 +2654,10 @@ Feature: Generate a POT file of a WordPress project | |
| __( 'Hello World', 'foo-plugin' ); | ||
| """ | ||
|
|
||
| When I try `wp i18n make-pot foo-plugin --debug` | ||
| When I run `wp eval "echo DIRECTORY_SEPARATOR;"` | ||
| And save STDOUT as {DIRECTORY_SEPARATOR} | ||
|
swissspidy marked this conversation as resolved.
|
||
|
|
||
| And I try `wp i18n make-pot foo-plugin --debug` | ||
| Then STDOUT should be: | ||
| """ | ||
| Plugin file detected. | ||
|
|
@@ -2653,7 +2673,7 @@ Feature: Generate a POT file of a WordPress project | |
| """ | ||
| And STDERR should contain: | ||
| """ | ||
| foo-plugin/foo-plugin.php | ||
| foo-plugin{DIRECTORY_SEPARATOR}foo-plugin.php | ||
| """ | ||
| And STDERR should contain: | ||
| """ | ||
|
|
@@ -2707,7 +2727,10 @@ Feature: Generate a POT file of a WordPress project | |
| */ | ||
| """ | ||
|
|
||
| When I try `wp i18n make-pot foo-theme --debug` | ||
| When I run `wp eval "echo DIRECTORY_SEPARATOR;"` | ||
| And save STDOUT as {DIRECTORY_SEPARATOR} | ||
|
|
||
| And I try `wp i18n make-pot foo-theme --debug` | ||
| Then STDOUT should be: | ||
| """ | ||
| Theme stylesheet detected. | ||
|
|
@@ -2723,7 +2746,7 @@ Feature: Generate a POT file of a WordPress project | |
| """ | ||
| And STDERR should contain: | ||
| """ | ||
| foo-theme/style.css | ||
| foo-theme{DIRECTORY_SEPARATOR}style.css | ||
| """ | ||
| And STDERR should contain: | ||
| """ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping the
<?phpline from the expected content makes this assertion much less strict and could let a regression slip through (e.g., missing PHP open tag) just to work around line-ending differences. A more robust approach is to assert<?phpand thereturn [...]payload separately (or use an assertion that’s tolerant of CRLF between lines) so Windows compatibility doesn’t reduce coverage.