[cells-devel] trc strangeness

Andy Chambers achambers.home at googlemail.com
Thu Jun 12 14:10:17 UTC 2008


Hi All,

I've just come across some unintuitive behavior in trc that maybe
you're interested in.

I was writing the following unit-test for openair and the (check
(search "status" ...) was failing, even though the trc just above it
showed that "status" was clearly in the output.

Turns out, when you just (princ (update chkbx)), the value that
appears is "STATUS" (which is what I should have been testing for
anyway).  It was just baffling though to have trc tell me that the
strings should match, but when the test actually runs, they don't.  I
think this is because I still don't understand properly how print and
friends work.

(deftest test-updates ()
  (cells-reset)
  (princ #\Newline)
  (let* ((app (mk-web-app (:prefix "/app")

	       (make-instance 'md-name-test
                  :fm-parent *parent*)))
	 (page (car (resource app)))
	 (chkbx (fm-other :status :starting page)))
    (declare (ignorable app page chkbx))
    (check (search "value='off'" (xhtml chkbx)))

    (add-post app "STATUS" "on")

    (check (search "value='on'" (xhtml chkbx)))
    (trc "upd" (update chkbx))
    (check (search "status" (update chkbx)))
    (check (search "value=\\'on\\'" (update chkbx)))))


-- 
Andy



More information about the cells-devel mailing list