tests for types and protocols

1 view
Skip to first unread message

Mike Hinchey

unread,
Jan 16, 2010, 4:47:01 AM1/16/10
to cloju...@googlegroups.com
I started writing some tests for core_deftype.  I marked some questions or possible errors as TODO in the source.  Let me know if you have any feedback and I'll fix it up.  And I'll work on more of the tests as time permits.  I can resubmit a single patch when it's all ready if you prefer.

http://github.com/mikehinchey/clojure/commit/242d477423ef4df21b0f70e2a19a9ef68ea2b5df

The patch also includes an NPE check in the compiler that I found while writing the tests.  It happens when a protocol is defined, then edited to remove a method, but user code still references the method, which is likely to happen during development.

Also, the doc isn't saved on protocols and methods, meta returns nil.

-Mike

Jarkko Oranen

unread,
Jan 18, 2010, 6:43:56 AM1/18/10
to Clojure Dev
On Jan 16, 11:47 am, Mike Hinchey <hinche...@gmail.com> wrote:
> I started writing some tests for core_deftype.  I marked some questions or
> possible errors as TODO in the source.  Let me know if you have any feedback
> and I'll fix it up.  And I'll work on more of the tests as time permits.  I
> can resubmit a single patch when it's all ready if you prefer.
>
> http://github.com/mikehinchey/clojure/commit/242d477423ef4df21b0f70e2...

>
> The patch also includes an NPE check in the compiler that I found while
> writing the tests.  It happens when a protocol is defined, then edited to
> remove a method, but user code still references the method, which is likely
> to happen during development.
>
> Also, the doc isn't saved on protocols and methods, meta returns nil.
>
> -Mike

The NPE fix is a logically separate change from the tests, so it
should really be split into its own commit. Doing that will change
history though, so when you push it to a remote repo you will probably
need to use some --force. :)

Git can generate a single patch file from multiple commits using "git
format-patch --stdout base-branch > combo.patch", so you can avoid
messing with multiple files.

--
Jarkko

Reply all
Reply to author
Forward
0 new messages