-
Notifications
You must be signed in to change notification settings - Fork 4
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
Should XFAIL_IF need parentheses? #141
Comments
Counterquestion: Our tests (as well as my code) seem to use the idiom In general I would only expect 1+2 to work. If we support the latter syntax then 3+4 seem problematic. Otherwise I have less strong of an opinion and would go for whatever is most robust to parse (but perhaps not document 3+4?). I concur that breaking on |
While we're listing stuff: its not obvious to me how where "and/or" goes in:
(and similarly for
|
I just checked and Python supports both of the following syntaxes:
and
PS: I'd be fine with deviating from Python's path if there is a clearly more idiomatic Octave way of doing things. |
Re your other question, I remember running into the same problem a while ago. Let me try to find a reference. |
So our implementation calls We briefly touched upon this subject in #112 but there was no conclusive reasoning. I'd say that it is perhaps the more intuitive behavior: So your changes will enable combining conditions via |
|
😄 Clearly we also need |
Seems the important decision is whether we support these:
It does seems nice and clean to be able to combine them... |
I filed a separate bug #144. |
I'm unsure how to extend my regexp to support:
The regexp will glob
then need backtracking etc... |
Maybe a better approach would be to first break-up the string based on a regexp looking for DIRECTIVEs and comment chars. Then, in a second step, everything between those tokens must be either whitespace or arguments to non-nullary directives. I think that might take me a while: I'm not going to try it now. An much simpler approach would be to tell people they must not use whitespace inside the arguments:
(although doctests should be readable!) |
I agree that this all sounds a bit involved. Python has it easy with its I think the |
Sounds good. And the answer to this particular issue is "Yes". Closing. |
Regular
if
does not need parentheses (although I often put them anyway).Which of these would you expect to work?
XFAIL_IF(foo())
(currently ok)XFAIL_IF (foo())
(we should allow this, its possibly broken/untested currently, FIXME)XFAIL_IF is_some_test(42)
XFAIL_IF DOCTEST_MATLAB
We could go with your idea of forbidding
%
and#
from appearing in the directive conditional (and damn those who wish to printf in there). This would simply the regex a bit, perhaps have fewer corner cases to worry about (e.g., your various comment cases mentioned earlier).The text was updated successfully, but these errors were encountered: