
I thought you just wanted this for define-check
, and the trouble with define-check
is that when it raises an exception it always says 1 test failed

so changing fail-check
to get rid of the “1 failure” would fix that issue

I don’t really understand the second thing you last said —

is that a problem with (check-fail (my-check ....))
?

yes, I meant it’s a problem with the hypothetical (check-fail (my-check ....))
idea

the high level thing I want is a way to test custom checks so I know they pass when I expect, fail when I expect, and add whatever specialized check-info I expect

ok, yes

it’s easy enough to test that a custom check passes when you expect; just write some tests using it

the other two things I have no idea how to do reasonably and I think it would be useful for rackunit to provide ways to do that

a neat side effect might be that rackunit can simplify its own test suite

haha yeah, I was just wondering what rackunit does

some of the tests rely on calling a module with failing tests in a separate namespace and checking the stderr output

that… I would like to avoid :p

@samth @pnwamk I’m trying to work on types for immutable data and I have a problem

I just added some cases to types/subtype.rkt
and am getting “unbound identifier uid:Immutable-Hashtable:
”

I’m trying to read the source, but I haven’t found where the uid:
is supposed to get defined

(I have a def-structural Immutable-Hashtable ....
with its own mask)

oh

I had written (case: Immutable-Hashtable: (Immutable-Hashtable: k v))

but it should be (case: Immutable-Hashtable (Immutable-Hashtable: k v))

@ben I’ve got an experimental change to rackunit that extracts the rackunit/text-ui
code into a separate package, do you think that’s a reasonable idea?

I’m not sure

I think that should be OK to do … but I also think that shouldn’t be necessary

because (I hope) nothing in rackunit depends on rackunit/text-ui

why do you want the separate package?

(I’m guessing its to make rackunit more testable, I just don’t see how, yet)

I’m trying to figure out what parts of run-tests
need to be changed to make it easier for me to implement things like https://github.com/racket/rackunit/issues/10

because it currently uses a lot of internal details of the error message format and duplicates a bunch of logic in display-test-failure/error
but with slight variations

so the separate package is an attempt to figure out what the hard boundary between run-tests
and the core of rackunit is

ok I like all of this

from reading the commit history I think Robby wanted to move towards making run-tests
behave a lot more like display-test-failure/error


@samth @pnwamk another question, I’m having trouble with base-env/base-types.rkt

I’m able to do things like (def-structural T (args ....))
, then apply T like a function in base-env/base-types.rkt
(I mean, I can write (T arg ...)
)

but

I want to define -HT
as a name for (-poly (a b) (Un (T1 a b) (T2 a b)))
(for some T1
T2
)

so I tried (define -HT (-poly ....))
and then I can’t write (-HT a b)
later in base-env/base-types.rkt

I guess the question is, how do I define a polymorphic type?

@ben you seem to be confusing polymorphic types and functions

should I do (define -HT (lambda (a b) (-poly ....)))
?

TR makes them seem like the same thing in the surface syntax

But the first thing you wrote was a polymorphic type, and the second is a function

It depends what you want

(-poly ...)
is a polymorphic type, (lambda (a b) ...
is a function? ok that makes sense

Yes

-poly is just a shorthand for a type constructor

so I guess I have to read def-structural
to see what its making?

It’s making types and type constructors

is there a type constructor for -poly
?

There’s several levels of abstraction there to manage the binding

But -Poly is the function

I don’t recommend using it directly though

@notjack I found that rackunit’s output when tests aren’t in a test suite to be hard to read and so I tried to clean things up to make that usecase a little bit nicer.