-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Test convert CompletionInput into string #57570
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
Conversation
@@ -53,7 +53,7 @@ public static function fromString(string $inputStr, int $currentIndex): self | |||
* Create an input based on an COMP_WORDS token list. | |||
* | |||
* @param string[] $tokens the set of split tokens (e.g. COMP_WORDS or argv) | |||
* @param $currentIndex the index of the cursor (e.g. COMP_CWORD) | |||
* @param int $currentIndex the index of the cursor (e.g. COMP_CWORD) |
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.
int
is missing from this @param
dockblock.
It's weird. I think the CI error might not be related to this test. Am I right? |
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.
Failures unrelated indeed.
@@ -133,4 +133,19 @@ public static function provideFromStringData() | |||
yield ['bin/console cache:clear "multi word string"', ['bin/console', 'cache:clear', '"multi word string"']]; | |||
yield ['bin/console cache:clear \'multi word string\'', ['bin/console', 'cache:clear', '\'multi word string\'']]; | |||
} | |||
|
|||
public function testToString() |
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.
We could perhaps use a dataProvider for this test to avoid duplicating code ?
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.
Before adding this, I read ArgvInputTest
and ArrayInputTest
. There both don't use a dataProvider. Personally, I think use or not use dataProvider
here is fine because there are only 2-3 cases.
If it's neccessary, I will implement. And we should implement for ArgvInputTest
and ArrayInputTest
too, shouldn't we?
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.
Oh no, it's not necessary, it's really just a matter of separating the test data from the test itself, but you're right, the code is simple and it's all detail.
Thank you @seriquynh. |
CompletionInput can be converted into string but there are no tests for it. So, I a simple test here based on it's current behavior.