ben
2017-6-11 07:07:04

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


ben
2017-6-11 07:07:31

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


ben
2017-6-11 07:08:07

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


ben
2017-6-11 07:08:22

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


notjack
2017-6-11 07:08:59

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


notjack
2017-6-11 07:09:10

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


ben
2017-6-11 07:09:47

ok, yes


notjack
2017-6-11 07:09:49

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


notjack
2017-6-11 07:10:13

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


notjack
2017-6-11 07:20:06

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


ben
2017-6-11 07:20:30

haha yeah, I was just wondering what rackunit does


notjack
2017-6-11 07:21:07

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


notjack
2017-6-11 07:21:26

that… I would like to avoid :p


ben
2017-6-11 21:40:04

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


ben
2017-6-11 21:40:43

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


ben
2017-6-11 21:41:16

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


ben
2017-6-11 21:42:07

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


ben
2017-6-11 21:48:51

oh


ben
2017-6-11 21:49:10

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


ben
2017-6-11 21:49:23

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


notjack
2017-6-11 22:15:10

@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?


ben
2017-6-11 22:17:45

I’m not sure


ben
2017-6-11 22:18:07

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


ben
2017-6-11 22:18:22

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


ben
2017-6-11 22:18:29

why do you want the separate package?


ben
2017-6-11 22:18:50

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


notjack
2017-6-11 22:19:22

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


notjack
2017-6-11 22:20:02

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


notjack
2017-6-11 22:20:33

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


ben
2017-6-11 22:20:57

ok I like all of this


notjack
2017-6-11 22:21:12

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


notjack
2017-6-11 22:22:53

https://github.com/racket/rackunit/pull/34 is slightly related as well


ben
2017-6-12 00:46:48

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


ben
2017-6-12 00:48:11

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 ...))


ben
2017-6-12 00:48:13

but


ben
2017-6-12 00:48:57

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


ben
2017-6-12 00:49:30

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


ben
2017-6-12 00:49:51

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


samth
2017-6-12 00:49:58

@ben you seem to be confusing polymorphic types and functions


ben
2017-6-12 00:50:18

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


samth
2017-6-12 00:50:20

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


samth
2017-6-12 00:50:44

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


samth
2017-6-12 00:51:04

It depends what you want


ben
2017-6-12 00:51:14

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


samth
2017-6-12 00:51:21

Yes


samth
2017-6-12 00:51:48

-poly is just a shorthand for a type constructor


ben
2017-6-12 00:52:18

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


samth
2017-6-12 00:52:40

It’s making types and type constructors


ben
2017-6-12 00:56:41

is there a type constructor for -poly?


samth
2017-6-12 00:59:13

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


samth
2017-6-12 00:59:33

But -Poly is the function


samth
2017-6-12 00:59:53

I don’t recommend using it directly though


robby
2017-6-12 01:11:12

@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.