Skip to content
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 tests cases for make_* system macros #135

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

popematt
Copy link
Contributor

Issue #, if available:

#88

Description of changes:

Adds actual test cases for all of the make_* system macros.

Things to review:

  • Do the test cases accurately implement the descriptions?
  • Are there any edge cases that are missing?
  • Are the parameter encoding tests for make_timestamp correct? (I think they are, but I need confirmation.)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@popematt popematt requested a review from zslayton November 21, 2024 00:08
Copy link
Contributor

@zslayton zslayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

(produces {foo:0} ))
(then "a symbol with unknown text"
(text "(:make_field $0 1)")
// Could be (produces {$0:1} ), but some implementations don't support $0 nicely.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is saying "$0 support is often bad early in an implementation's development" right? If so, I agree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and it's also exposing a weakness in IonElement—it doesn't have any support for $0, but we're using it in the conformance runner in ion-java because it's so much easier to work with than IonValue.

"in text using qualified system macro address 7"
(text " (:$ion::7 1) ")
"in binary using system macro address 7"
(binary "EF 07 00 00 01 00")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, make_timestamp is the only system macro that requires a 2-byte arg encoding bitmap. I think this is probably ok since most of its value proposition comes from usage in TDL, but it is eye-catching.

conformance/system_macros/make_symbol.ion Outdated Show resolved Hide resolved
conformance/system_macros/make_struct.ion Outdated Show resolved Hide resolved
@popematt popematt merged commit fd9013a into amazon-ion:main Nov 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants