ion-tests icon indicating copy to clipboard operation
ion-tests copied to clipboard

Clarity on intent of good/testfile35.ion

Open siler opened this issue 4 years ago • 4 comments

It looks like this test is attempting to cause an Ion parser to load a shared symbol table into its catalog. According to my read of the spec, however, the following top level value in the file is actually user data:

$ion_shared_symbol_table::{
  name:"test", version:1, 
  symbols:["dates","whenDate"]
}

Related section describing shown syntax: http://amzn.github.io/ion-docs/docs/symbols.html#shared-symbol-tables

This section defines the serialized form of shared symbol tables. Unlike local symbol tables, the Ion parser does not intrinsically recognize or process this data; it is up to higher-level specifications or conventions to define how shared symbol tables are communicated.

It seems like this is building towards a catalog-aware test suite that has a superset of semantics, similar to the embedded_document concept or the good/bad equivalencies files, which could be use to flex the catalog aspect of Ion.

siler avatar Mar 08 '20 21:03 siler

Right. There are currently a few different test files that include shared symbol tables (which, as you say, would be interpreted as user data under the current test semantics) and/or unresolvable shared symbol table imports. I believe ion-java whitelists some of these and applies its own catalogs to them in hand-written unit tests. I agree that we need to add some semantics to ion-tests itself that dictate how to implement this across all implementations. There's is brief discussion of that here.

tgregg avatar Mar 09 '20 19:03 tgregg

Sorry to jump into here, but this was the only search result for embedded_document.

There's is brief discussion of that here.

Oh lord. So is it embedded_document:: or $ion_embedded_whathever:: now? Why are unfinished specs included in a test suite? Please, if possible, advise how to proceed. At least, ion-c, as of now, doesn't do anything with embedded_document::.

m6w6 avatar Dec 15 '21 19:12 m6w6

So is it embedded_document:: or $ion_embedded_whathever:: now?

It's still embedded_documents. The linked ion-test-driver spec includes the implicit proposal to change it to $ion_embedded_streams (because reserved Ion annotations are supposed to start with $ion_), but that proposal hasn't yet been implemented. We should probably change that documentation to refer to embedded_documents until we make the change, to avoid this confusion.

To be clear, embedded_documents are only recognized in ion-tests files. This is not part of the Ion format specification. ion-c actually does handle embedded_documents in tests; the special annotation is defined here.

tgregg avatar Dec 15 '21 20:12 tgregg

Thank you for the clarification and the hint at the location within tools/ion_events lib.

m6w6 avatar Dec 16 '21 07:12 m6w6