-
Notifications
You must be signed in to change notification settings - Fork 14
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
Adds readers for element and logic constraints #260
Conversation
import org.junit.jupiter.params.provider.ValueSource | ||
|
||
@ExperimentalIonSchemaModel | ||
class LogicConstraintsReaderTest { |
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.
🗺️ The tests here are intentionally sparse. canRead
is completely covered, but tests for read
cover only a few cases since comprehensive testing is handled with the ion-schema-tests
test cases.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #260 +/- ##
=========================================
Coverage ? 82.72%
Complexity ? 810
=========================================
Files ? 118
Lines ? 3057
Branches ? 602
=========================================
Hits ? 2529
Misses ? 366
Partials ? 162
☔ View full report in Codecov by Sentry. |
I'm not sure why Codecov says that some of the lines aren't covered, but it's possibly related to #221. Edit—switching to |
} | ||
ion is IonStruct -> { | ||
islRequire(!ion.containsKey("name")) { "Inline type definitions may not have a 'name' field" } | ||
islRequire(!ion.containsKey("occurs")) { "Inline type definitions may not have a 'occurs' field" } |
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.
(non-blocking) If this will be used by group of constraints then we should probably add a check here that allows occurs
for ordered_elements
and fields
. If you are planning to do this in a separate PR then you can disregard this.
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.
That's going to be handled by readVariablyOccurringTypeArg
function (currently has a stub implementation on L70 of this file).
Issue #, if available:
#256
Description of changes:
Implements
readTypeArg()
and adds readers for some constraints that depend on type arguments (element
and the "logic" constraints). UpdatesReaderTests
to cover all of the constraints readers that were added and the$null_or
test cases.Related PRs in ion-schema, ion-schema-tests, ion-schema-schemas:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.