Re: Test elem1 in the test suite

Norm Tovey-Walsh writes:

> Test elem1 is:

> a: "a", b, c.
> b: "b", c, d.
> c: "c", []. {it should block here, since nothing matches}
> d: "d".

> And it’s a syntax test that is suppose to fail:

>     <test-case name="elem1">
>       <test-string-ref href="elem1.ixml"/>
>       <result><assert-not-a-sentence/></result>
>     </test-case>

> I interpret the comment to mean that this test should fail because “[]”
> isn’t valid, but that’s not right:

> -set: -"[", s,  member*(-[";|"], s), -"]", s.

> What am I failing to understand about this test?

Good catch.

One possibility is that the test case was formulated before the grammar
of character sets was changed to allow them to be empty; against the
then-current ixml specification grammar, it would not be grammatical.

But the phrasing of the comment would be distinctly odd in that case:
given the old definition of character sets, the natural description of
[] is that it's an error, not that it matches nothing.

The second possibility that occurs to me is that the test case ended up
in the wrong directory.  It looks to me (by eye) like a perfectly fine
grammar, so it does not belong in a directory of non-conforming
grammars.  (It would be less of an outlier in Steven's tests/
directory, I think.)

Since I'm always reluctant to let a good test go to waste, my
inclination would be to move it to the tests-SP-MSM directory, give it
some inputs, and specify that none of the inputs are sentences.

My two cents.

Michael


-- 
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
http://blackmesatech.com

Received on Saturday, 5 February 2022 14:25:08 UTC