Code Monkey home page Code Monkey logo

Comments (8)

landro avatar landro commented on June 9, 2024 2

@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.

from testcl.

carlpett avatar carlpett commented on June 9, 2024

@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?

from testcl.

jamespic avatar jamespic commented on June 9, 2024

@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.

from testcl.

carlpett avatar carlpett commented on June 9, 2024

@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?

from testcl.

nickm4062 avatar nickm4062 commented on June 9, 2024

👍

from testcl.

landro avatar landro commented on June 9, 2024

@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

from testcl.

carlpett avatar carlpett commented on June 9, 2024

@landro It works! Thanks a lot, great work!

from testcl.

landro avatar landro commented on June 9, 2024

fixed in 99ab81f

from testcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.