Arc Forumnew | comments | leaders | submitlogin
3 points by akkartik 2961 days ago | link | parent

Hmm, strangely I just sent you a pull request to update the Readme. I'm not too familiar with Mercurial or Bitbucket; maybe I'm doing something wrong?

https://bitbucket.org/zck/unit-test.arc/pull-requests/2/upda...

I'll play with it today or tomorrow and make sure all of Anarki's tests update correctly.



3 points by zck 2960 days ago | link

Yeah, that was right. Thanks for catching the readme changes -- I guess I had made some but not all.

-----

4 points by akkartik 2957 days ago | link

I've updated my script to auto-upgrade Anarki tests[1], and things look pretty good. Just a couple of minor comments:

a) I see a message about redefining assert. Perhaps we should change the name in Anarki or unit-test.arc?

b) The new version complains about duplicate nested suite names inside a test suite. That seems like a reasonable idea, and I just want to confirm that it's intended.

c) If you have a duplicate test name in a suite the error is confusing. Here's the example I ran into from Anarki:

  $ cat x.arc
  (load "unit-test.arc/unit-test.arc")

  (suite cut
    (test finds-element-in-string
      (assert-same '(3 4 5) (cut '(1 2 3 4 5) 2)))
    (test finds-element-in-string        ; duplicate name
      (assert-same "cde" (cut "abcde" 2)))
  )

  (test)

  $ ./arc.sh x.arc
  Can't coerce  #<procedure: cut> string
    context...:
     anarki/ac.scm:1015:0: ar-coerce
      map1
      map1
      string
     anarki/ac.scm:1279:0: aload1
Once you switch to unique names everything works fine. But perhaps we can improve the error message?

[1] I'll post the final script here once we "launch".

-----

4 points by zck 2957 days ago | link

Yes, it's a desired feature that a suite can't contain two things with the same name -- either suites, tests, or one suite and one test. This is because I want names to be unique. Saying (test cut.finds-element-in-suite) shuld run only one test.

What you ran into is actually a bug I fixed at a meetup on Tuesday. The current error message is:

  Error: "In suite cut, there are two things named finds-element-in-string."
The commit is here: https://bitbucket.org/zck/unit-test.arc/commits/bb41b4183938.... Can you re-pull (hg pull; hg update) and see if it works then? The most recent commit is 96652e5.

-----

3 points by akkartik 2957 days ago | link

Ah, you're right. Looks great now!

-----