Has anyone managed to import one of the Stunt *_tests packages?

2 views
Skip to first unread message

d. kajsh

unread,
May 26, 2012, 11:19:44 AM5/26/12
to MOO-...@googlegroups.com
I was interested to see if writing tests for some of my MOO code would
be worthwile with the tools provided in Stunt, and wanted to look at
some of the existing test packages. None of them seem to import, though.
"Package requires:  {{"core", ">= 1.0.5"}}"

Todd Sundsted

unread,
May 26, 2012, 12:39:04 PM5/26/12
to MOO Talk
That dependency is left over from earlier days (when there was an
actual "core" package). The only real dependency was on `$unit',
which was once part of "core". I will fix the dependency and re-
release.

A few notes on testing...

There is a `@test' command verb, which will run all installed tests.
That's usually not what I want. I typically use the `run_tests()'
verb on a child of $unit.test directly. This will run all runnable
verbs defined on the object, like so (#22910 is "Verb Code Tests" in
my local database):

;; #22910:run_tests():each("l", "notify(player, l);")

Which will output something like:

...
test_that_changes_mark_a_verb_as_dirty was successful
test_that_commit_marks_a_verb_as_clean was successful
test_that_revert_marks_a_verb_as_clean was unsuccessful: assert_equal
failed at #22910:test_that_revert_marks_a_verb_as_clean, line 16:
"dirty" is not equal to "clean"
0

(The `each(...)' call requires the "primitive" package. If you don't
have that installed, just use a `for' loop on the results of
`run_tests()' to pretty-print.)

Also, don't release a production core with any of the test packages.
Test packages/verbs often need wiz-perms, etc. to test what they are
supposed to test, but securing them doesn't make a lot of sense and
would be a lot of extra work. Keep that in mind.

Todd

Todd Sundsted

unread,
May 26, 2012, 1:53:34 PM5/26/12
to MOO Talk
I just did a sloppy release of kernel_tests version 1.0.10 that only
depends on the "kernel" package and the "unit" package. It's sloppy
because some of the tests don't pass (some tests themselves depend on
the non-existent "core" package), which sucks, to be sure... I will
be fixing all of these problems in 1.0.11...

Todd
Reply all
Reply to author
Forward
0 new messages