Skip to content

Commit

Permalink
Add test that reads ion-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpschorr committed Feb 5, 2025
1 parent f8a7900 commit 116ba5b
Show file tree
Hide file tree
Showing 6 changed files with 1,821 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "partiql-conformance-tests/partiql-tests"]
path = partiql-conformance-tests/partiql-tests
url = https://github.com/partiql/partiql-tests.git
[submodule "extension/partiql-extension-ion/resources/ion-tests"]
path = extension/partiql-extension-ion/resources/ion-tests
url = https://github.com/amazon-ion/ion-tests/
1 change: 1 addition & 0 deletions extension/partiql-extension-ion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ peekmore = "1.3"

[dev-dependencies]
insta = "1"
walkdir = "2.5"

[features]
default = []
Expand Down
1 change: 1 addition & 0 deletions extension/partiql-extension-ion/resources/ion-tests
Submodule ion-tests added at a22bf4
11 changes: 7 additions & 4 deletions extension/partiql-extension-ion/src/boxed_ion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,14 @@ impl BoxedIon {
}
BoxedIonStreamType::Stream => BoxedIonValue::Stream(),
BoxedIonStreamType::SingleTLV => {
let elt = reader.next().expect("ion value")?;
if reader.peek().is_some() {
// TODO error on stream instead of TLV?
if let Some(elt) = reader.next() {
if reader.peek().is_some() {
// TODO error on stream instead of TLV?
}
BoxedIonValue::Value(elt?)
} else {
BoxedIonValue::Sequence(Vec::new().into())
}
BoxedIonValue::Value(elt)
}
})
}
Expand Down
Loading

0 comments on commit 116ba5b

Please sign in to comment.