amazon-ion / ion-schema-rust

Rust implementation of Ion Schema
https://amazon-ion.github.io/ion-schema/sandbox
Apache License 2.0
13 stars 6 forks source link

adds changes for `byte_length` and `codepoint_length` constraint #72

Closed desaikd closed 2 years ago

desaikd commented 2 years ago

Issue #9 #10

Description of changes: This PR works on adding implementation of byte_length and codepoint_length constraint.

Grammar:

<BYTE_LENGTH> ::= byte_length: <INT>
                | byte_length: <RANGE<INT>>

<CODEPOINT_LENGTH> ::= codepoint_length: <INT>
                     | codepoint_length: <RANGE<INT>>

Ion Schema specification: https://amzn.github.io/ion-schema/docs/spec.html#byte_length https://amzn.github.io/ion-schema/docs/spec.html#codepoint_length

List of changes:

Tests: added unit tests for byte_length and codepoint_length implementation.