Skip to content

Commit

Permalink
Adding tests from Issue usnistgov#224
Browse files Browse the repository at this point in the history
  • Loading branch information
wendellpiez committed Aug 30, 2022
1 parent 627081c commit beb41e2
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<field-datetime>2022-08-29T16:01:50-04:00</field-datetime> these are okay -->
<field-datetime>2022-08-29T16:01:50-4:00</field-datetime><!-- missing a leading zero s/4:00/04:00 -->
<field-datetime>2022-08-29T16:01:500-04:00</field-datetime><!-- too many zeros s/01:500/01:50 -->
<field-datetime>2022-08-29T16:01:50.010-04:00</field-datetime><!-- insignificant 'decimal' sequence trailing zero s/01:500/01:50 -->
<field-datetime>2022-08-29T16:01:50.010-04:00</field-datetime><!-- insignificant 'decimal' sequence trailing zero s/01:5010/01:501 -->
<!--<field-datetime>2022-08-29T16:01:50</field-datetime>
<field-datetime>2020-01-01T12:00:00</field-datetime>-->
<child>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<parent xmlns="http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime"
flag-datetime="2022-08-29T16:00:00-04:00">
<!-- regex working set here: https://regex101.com/r/HIuUPe/1 -->
<field-datetime>2022-07-29</field-datetime><!-- just a date -->
<field-datetime>2022-11-30</field-datetime><!-- just a date -->
<field-datetime>2022-11-30T21:29:17.01234567890000Z</field-datetime><!-- trailing zeros -->
<field-datetime>2022-11-30T21:29:17.01234567890000-04:00</field-datetime><!-- trailing zeros -->
<field-datetime>2022-11-30T21:29:17.01234567890000-99:99</field-datetime><!-- trailing zeros -->
<field-datetime>2022-06-15T21:29:17.84+12:46</field-datetime><!-- wrong offset -->
<field-datetime>2022-06-15T21:29:17.84+14:99</field-datetime><!-- wrong offset -->
</parent>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<parent xmlns="http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime"
flag-datetime="2022-08-29T16:00:00-04:00">
<!-- regex working set here: https://regex101.com/r/HIuUPe/1 -->
<field-datetime>2022-07-29T13:25:15Z</field-datetime>
<field-datetime>2022-07-29T13:25:15.39Z</field-datetime>
<field-datetime>2022-07-29T13:25:15-04:00</field-datetime>
<field-datetime>2022-07-29T13:25:15.59-04:00</field-datetime>
<field-datetime>2022-11-30T21:29:17Z</field-datetime>
<field-datetime>2022-11-30T21:29:17.84Z</field-datetime>
<field-datetime>2022-11-30T21:29:17-04:00</field-datetime>
<field-datetime>2022-11-30T21:29:17.84-04:00</field-datetime>
<field-datetime>2022-11-30T21:29:17.84-04:00</field-datetime>
<field-datetime>2022-06-15T21:29:17Z</field-datetime>
<field-datetime>2022-06-15T21:29:17.84Z</field-datetime>
<field-datetime>2022-06-15T21:29:17+04:00</field-datetime>
<field-datetime>2022-06-15T21:29:17.84+04:00</field-datetime>
<field-datetime>2022-06-15T21:29:17.84+12:45</field-datetime>
<field-datetime>2022-06-12T21:29:17.84-12:00</field-datetime>
<field-datetime>2022-06-15T21:29:17.84+14:00</field-datetime>
</parent>
19 changes: 19 additions & 0 deletions test-suite/worked-examples/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Worked Examples - Metaschema

Current status: **some updates needed**

Anthology example is working - shows 'plausible' use cases for a range of different metaschema modeling features.

'Everything' metaschema has not been updated and needs refreshing.

## TODO

test
schema validations
M4 and oscal-cli schemas
round tripping
unit test any repairs?

review ../schema-generation/

See work in `../schema-generation/json-value-key` and `group-as`

0 comments on commit beb41e2

Please sign in to comment.