From 5d0a390b613267964d7515895966867b6cdc7657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Wed, 3 Feb 2016 17:07:26 +0100 Subject: [PATCH] Cleaned tests for FB case 94 (logn match on a predefined set of identifiers). --- graph-lib/lib/low/logn-id.rkt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/graph-lib/lib/low/logn-id.rkt b/graph-lib/lib/low/logn-id.rkt index 42fab0b0..093e011a 100644 --- a/graph-lib/lib/low/logn-id.rkt +++ b/graph-lib/lib/low/logn-id.rkt @@ -6,6 +6,8 @@ racket/match syntax/stx)) +(provide define-logn-ids) + (begin-for-syntax (define (insert make-node v ts) (match ts @@ -60,6 +62,16 @@ #'(let ([v-cache v]) #,(make-btd bt))])))])) -(define-logn-ids match-x [a A] [b B] [c C] [d D] [e E]) - -(match-x b [a 1] [b 2] [c 3] [d 4] [e 5]) \ No newline at end of file +(module* test typed/racket + (require (submod "..") + typed/rackunit) + + (define-logn-ids match-x [a A] [b B] [c C] [d D] [e E]) + + (check-equal? (match-x (ann b (U A B C D E)) + [a 1] + [b 2] + [c 3] + [d 4] + [e 5]) + 2)) \ No newline at end of file