-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Remove erroneous curlies in Xml resource #33890
Conversation
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.
Looks good but I would either change the test to be locale-independent, or (if there's already functional coverage) consider not bothering with a test at all. This would be acceptable for any cases where you are literally just changing the text of the string and there are no replacement parameters in it.
src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs
Outdated
Show resolved
Hide resolved
Looks like test failures are unrelated - if you push your edit, it will run again. BTW, we prefer to set the PR title to something that mentions to issue, not a number. |
@danmosemsft Since I don't have this information, I've decided to proceed with unit tests. I suspect that if unit tests did cover these strings, they would have had proper formatters in them. Also, it confirms to me that I understand exactly when these are being used. In looking at Sch_LengthGtBaseLength, I have come up with two questions. This resource is only used in method CompileLengthFacet in file FacetChecker.cs:
I can trigger the exception to throw with the message SR.Sch_LengthGtBaseLength by specifying a length facet in both a base type and a derived type, with the derived type having a longer length. Q1: Isn't the length facet supposed to specify the exact length? If so, why is the second test above checking for "less than" rather than "not equal"? This is the test schema that I use to provoke the exception.
|
@mrj001 are the instructions in https://github.com/dotnet/runtime/blob/master/docs/workflow/building/libraries/code-coverage.md not working? If not @ViktorHofer owns them. For your other questions, @buyaa-n owns System.Xml and can help. |
src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs
Outdated
Show resolved
Hide resolved
Yes, but only for that type i assume (in this case the base type)
Because derived type can have length less than or equal to base type length, why do you think it must be equal?
Looks _baseFixedFlags is for only inferring if base type is fixed (which can be a boolean), but _baseFlags has RestrictionFlags of base (Length, MinLength, MaxLength ... etc)
I assume you need to set fixed value for base type definition for example: |
I initially relied on this page's description: For greater surety, see the note in paragraph 4.3.1.1 of: In Paragraph 4.3.1.4 of the same link:
And a unit test (failing) to demonstrate. Shall I file a separate issue? This is getting off topic of this pull request.
editted to fix hyperlinks. |
By counting my above comment your test should fail unless it has |
@buyaa-n
|
@mrj001 that is good point, I understand and really appreciate your effort for trying to make this right, but FYI we only support version 1.0 |
…rce Sch_InvalidExemplar as its message.
…dded the name of the element which cannot be used as the substitution group affiliation.
…string resource Sch_GroupBaseRestNotEmptiable as its message.
…string resource Sch_AllRefMinMax as its message.
…h similarly to Sch_LengthGtBaseLength
…Removed redundant ToLower call and comment.
…ing the successful case.
@danmosemsft I think @mrj001 addressed your change request, tests added using schema attribute names instead of entire error messages as string literal, tests looks good and improving code coverage, do you have any other comments/suggestions? Tagging also @krwq as he is back |
@buyaa-n don't wait on me, I trust your review |
Thanks, as you have requested change we still need your approval 😄, the merge button still disabled for me |
Oops, done |
Thank you @mrj001 for the contribution. Perhaps you'd be interested in looking at another issue that is labeled up for grabs. |
LGTM post merge |
This is addressing one of the 13 strings in issue 30218 that have faulty formatters (Sch_MinLengthGtBaseMinLength). I'd like some feedback on this approach before I tackle the other 12.