-
-
Notifications
You must be signed in to change notification settings - Fork 35
Make expErrors use an array (and only an array) #1076
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
base: main
Are you sure you want to change the base?
Changes from all commits
3f11bcb
51a2a4b
5db6c5d
7cde5a3
679ec61
989bdc0
542e6ec
c5f71d3
208f524
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 | ||||
---|---|---|---|---|---|---|
|
@@ -4,52 +4,59 @@ | |||||
"description": "Test cases for fallback behaviour.", | ||||||
"defaultTestProperties": { | ||||||
"bidiIsolation": "none", | ||||||
"locale": "en-US", | ||||||
"expErrors": true | ||||||
eemeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
"locale": "en-US" | ||||||
}, | ||||||
"tests": [ | ||||||
{ | ||||||
"description": "function with unquoted literal operand", | ||||||
"src": "{42 :test:function fails=format}", | ||||||
"exp": "{|42|}", | ||||||
"expParts": [{ "type": "fallback", "source": "|42|" }] | ||||||
"expParts": [{ "type": "fallback", "source": "|42|" }], | ||||||
"expErrors": [{ "type": "bad-operand" }] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... I found this confusing until I remembered that we agreed to use Unlike the other classes of error, MFE can have implementation-defined errors. We should make this clearer in the test suite text so that implementations do not merely ape our selection of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed on all counts. I also noticed while implementing this change that we lack a generic error for failures in formatting or selection, which could be due to the operand, options, or the phase of the moon. As in, values for which resolution succeeds, but then the |
||||||
}, | ||||||
{ | ||||||
"description": "function with quoted literal operand", | ||||||
"src": "{|C:\\\\| :test:function fails=format}", | ||||||
"exp": "{|C:\\\\|}" | ||||||
"exp": "{|C:\\\\|}", | ||||||
"expErrors": [{ "type": "bad-operand" }] | ||||||
}, | ||||||
{ | ||||||
"description": "unannotated implicit input variable", | ||||||
"src": "{$var}", | ||||||
"exp": "{$var}" | ||||||
"exp": "{$var}", | ||||||
"expErrors": [{ "type": "unresolved-variable" }] | ||||||
}, | ||||||
{ | ||||||
"description": "annotated implicit input variable", | ||||||
"src": "{$var :number}", | ||||||
"exp": "{$var}", | ||||||
"expParts": [{ "type": "fallback", "source": "$var" }] | ||||||
"expParts": [{ "type": "fallback", "source": "$var" }], | ||||||
"expErrors": [{ "type": "unresolved-variable" }, { "type": "bad-operand" }] | ||||||
}, | ||||||
{ | ||||||
"description": "local variable with unknown function in declaration", | ||||||
"src": ".local $var = {|val| :test:undefined} {{{$var}}}", | ||||||
"exp": "{$var}" | ||||||
"exp": "{$var}", | ||||||
"expErrors": [{ "type": "unknown-function" }] | ||||||
}, | ||||||
{ | ||||||
"description": "function with local variable operand with unknown function in declaration", | ||||||
"src": ".local $var = {|val| :test:undefined} {{{$var :test:function}}}", | ||||||
"exp": "{$var}" | ||||||
"exp": "{$var}", | ||||||
"expErrors": [{ "type": "unknown-function" }, { "type": "bad-operand" }] | ||||||
}, | ||||||
{ | ||||||
"description": "local variable with unknown function in placeholder", | ||||||
"src": ".local $var = {|val|} {{{$var :test:undefined}}}", | ||||||
"exp": "{$var}" | ||||||
"exp": "{$var}", | ||||||
"expErrors": [{ "type": "unknown-function" }] | ||||||
}, | ||||||
{ | ||||||
"description": "function with no operand", | ||||||
"src": "{:test:undefined}", | ||||||
"exp": "{:test:undefined}", | ||||||
"expParts": [{ "type": "fallback", "source": ":test:undefined" }] | ||||||
"expParts": [{ "type": "fallback", "source": ":test:undefined" }], | ||||||
"expErrors": [{ "type": "unknown-function" }] | ||||||
} | ||||||
] | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"defaultTestProperties": { | ||
"bidiIsolation": "none", | ||
"locale": "en-US", | ||
"expErrors": false | ||
"expErrors": [] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In fallback.md you left out There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aphillips It's required in this file otherwise some tests would be left without an expectation (e.g. lines 44-55). This would also be the case in As Eemeli mentioned in his review comment, I think we need to keep the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we are talking about I updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For In these 3 files we had tests with |
||
}, | ||
"tests": [ | ||
{ | ||
|
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.
(per my comment)