Update: Perl TM 1.42 - CTM support (experimental)

Available on CPAN: Perl TM 1.42

This version is really more a maintenance release, fixing some smaller annoyances and cleaning out the bugtracking backlog.

The CTM support is experimental, read-only (and will remain so) and it lacks some features:

  • reification of maps
  • %mergemap vs. %include directive
  • %encoding
  • comments

I found implementing CTM not quite easy, fortunately lheuer has prepared a number of useful test cases. My only problem with them is that they are VERY short, so that the tests cannot be intense enough for my taste.


Work supported by the Austrian Research Centers.

Posted In

CTM-test cases / CXTM test cases in general

Of course they are short because they test a particular aspect of CTM. All CXTM test cases are rather short for the same reason.

Feel free to contribute more test cases :)

Lars Heuer (not verified) | Tue, 07/01/2008 - 15:02

Re: CTM-test cases / CXTM test cases in general

... they test a particular aspect of CTM

Yes, that is all good and well, but many tests do not carry all complexity of a particular aspect.

So, for instance, the interplay of named wildwards with templates is spread over several use cases, (or maybe I just could find this particular test in the list). What I needed was:

  • have named wildcard ?x , ?y at the outside
  • have template with ?x inside (twice to 'merge')
  • have another template with ?x inside
  • have two instantiations of the templates, no merging with outside ?x or ?y
  • have named wildcard ?x at the outside to 'merge' with that first one

The small, individual tests carried some of the complexity, but not all.

rho | Tue, 07/01/2008 - 15:26

Wildcard testcases

have template with ?x inside (twice to 'merge')

If you have

?x. ?y.
def template()
?x.
end
template()

The ?x within the template won't be merged with the ?x outside the template. This is covered by the test cases
"template-wildcard-named.ctm", "template-wildcard-named2.ctm".

I do not claim that the test cases are complete (see STATUS and MISSING in the CVS), but if I understood your test cases correctly, they are covered. If not, an example may help me.

Lars Heuer (not verified) | Tue, 07/01/2008 - 16:15

Re: Wildcard testcases

I came up with the following, just to test with two templates. One would not unearth a problem if someone chooses to implement the namespaces "inside" and "outside". Also all possible sequences should be there: inside-outside-inside,
outside-inside-outside.

?xxx = http://topic.one/
- "James Bond" .

def TEMP ($l)
   ?yyy = http://topic.two/
   website: $l .

   ?yyy
   website: http://www.lennon3.com/ .
end

?xxx
website: http://www.lennon1.com/ .

TEMP ("http://www.lennon2.com/")

?yyy http://topic.three/
website: http://www.lennon4.com/ .

def TEMP2 ($l)
   ?yyy = http://topic.four/
   website: $l .

   ?yyy
   website: http://www.lennon5.com/ .
end

TEMP2 ("http://www.lennon4.com/")

And even that is probably not stressful above.

rho | Tue, 07/01/2008 - 16:38