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

Update symbolTablesUnknownText.ion #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rmarrowstone
Copy link
Contributor

Updates the test to verify that imported with undefined text are not equivalent to: other imported symbols with undefined text and different SIds, local symbols with undefined text, or symbols with defined text.

Before this change the differences in offset for the defined symbols alone was enough to cause it to pass.

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

Updates the test to verify that imported with undefined text are not equivalent to: other imported symbols with undefined text and different SIds, local symbols with undefined text, or symbols with defined text.

Before this change the differences in offset for the defined symbols alone was enough to cause it to pass.
version: 1,
max_id: 2 }
],
symbols:[ "foo", 31 ]
Copy link
Contributor

Choose a reason for hiding this comment

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

From https://amazon-ion.github.io/ion-docs/docs/symbols.html#local-symbol-tables

The symbols field should be a list of strings. If the field is missing or has any other type, it is treated as if it were an empty list.

Null elements in the symbols list declare unknown symbol text (“gaps”) for its SID within the sequence. Any element of the list that is not a string must be interpreted as if it were null. Any SIDs that refer to null slots in a local symbol table are equivalent to symbol zero.

What is this doing, why put a number here instead of an explicit null? Why 31?

Copy link
Contributor

Choose a reason for hiding this comment

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

This could be any non-string (or null), testing the case where"Any element of the list that is not a string must be interpreted as if it were null."

I'm sure we have tests elsewhere that ensure the implementation treats all non-strings as null slots.

@@ -1,25 +1,50 @@
// import declaration, with max_id > 0
// verifies that imported symbols with undefined text are not equivalent to:
// - other imported symbols with undefined text with different SIds
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// - other imported symbols with undefined text with different SIds
// - other imported symbols with undefined text with different SIDs

The symbols documentation generally says "SID"

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