Closed carlpett closed 8 years ago
@jamespic: From the commit log, it looks like you contributed this functionality - thanks for the effort! Do you have any insight in what could cause this? I tried running the test/test_class.tcl
file included in the release, and that does seem to work. However, it seems to be bypassing a lot of the "normal" import structure and instead including parts explicitly with source src/classes.tcl
and so on. I'm guessing that is not what I as an end user should do?
@carlpett It's been a while since I worked with the codebase, and my Tcl isn't that strong (I basically learned just enough to solve our problem, on the project where I used this), but my recollection is that we used explicit source src/classes.tcl
in our code.
I could readily believe that that's not the Tcl way, so feel free to refactor it to be more idiomatic.
@jamespic Thanks for the quick reply! I'm basically in the same boat, no tcl knowledge outside the quite simple stuff in irules. I'll try and see if I can get my rules and tests working by adding source
then.
@landro: If this is how it is meant to be done, I could try to update the examples?
@carlpett the way users should write tests, is by following the pattern found in the examples folder. The stuff found in tests is for testing the TesTcl itself (consider them unit-tests).
TesTcl heavily relies on the "unknown" command, which kicks in whenever an unknown/undefined proc is called, in this case the class command. I'll quickly check @jamespic's code to see if I can sort out what's going on. Stay tuned.
👍
@carlpett Could you please test the classes_fix branch and see if it works for you? I added an example that show how end users should use this functionality, see examples directory
@landro It works! Thanks a lot, great work!
fixed in 99ab81f78a45774fa6df4bd17d30a9051f7e3c16
Hi! I'm trying to follow the examples for classes from the documentation, but I can't get it to work. I'm getting syntax errors:
I'm using jtcl 2.8.0 and testcl 1.0.8 on Java 1.8.0_60, and start jtcl like this:
/opt/jdk/bin/java -DTCLLIBPATH=/jtcl/TesTcl -cp /jtcl/jtcl-irule.jar:/jtcl/jtcl-2.8.0.jar tcl.lang.Shell
.Some incompatibility with my versions, or error in the invocation?