I have this test:
(ns opengltuts.core-test (:use clojure.test opengltuts.util) (:import (org.lwjgl.opengl GL11 GL12 GL13 GL14 GL15 GL20 GL21 GL30 GL31 GL32 GL33))) (def gl-classes [GL11 GL12 GL13 GL14 GL15 GL20 GL21 GL30 GL31 GL32 GL33]) (deftest find-method-test (testing "find-method finds method in single class" (is (= (find-method "toString" Object) ["public java.lang.String java.lang.Object.toString()"]))) (testing "find-method finds all methods in list of classes" (is (= (apply find-method "glShaderSource" gl-classes) (comment "Omitted a 'p' to trigger failure") ["ublic static void org.lwjgl.opengl.GL20.glShaderSource(int,java.nio.ByteBuffer)" "public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.lang.CharSequence)" "public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.lang.CharSequence[])"]))))
Now I have made sure that this fails, I get the output, for example
lein test opengltuts.core-test FAIL in (find-method-test) (core_test.clj:14) find-method finds all methods in list of classes expected: (= (apply find-method "glShaderSource" gl-classes) ["ublic static void org.lwjgl.opengl.GL20.glShaderSource(int,java.nio.ByteBuffer)" "public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.lang.CharSequence)" "public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.lang.CharSequence[])"]) actual: (not (= ("public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.nio.ByteBuffer)" "public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.lang.CharSequence)" "public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.lang.CharSequence[])") ["ublic static void org.lwjgl.opengl.GL20.glShaderSource(int,java.nio.ByteBuffer)" "public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.lang.CharSequence)" "public static void org.lwjgl.opengl.GL20.glShaderSource(int,java.lang.CharSequence[])"])) Ran 1 tests containing 2 assertions. 1 failures, 0 errors. Tests failed.
I find this pretty impenetrable. Instead, I would prefer the output, for example:
<all that info stuff, like the name of the test> Expected: [something] Got: [something-else]
As is, I have problems just figuring out what I compared to that.
Cubic
source share