From ecf686cbb4589ad01e1fce4c81b7fb6a68dd013b Mon Sep 17 00:00:00 2001 From: Mustafa Date: Mon, 10 Mar 2014 10:22:17 -0700 Subject: [PATCH] tests --- sosc/sosc.rkt | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/sosc/sosc.rkt b/sosc/sosc.rkt index 0f600e4..4dabb7a 100644 --- a/sosc/sosc.rkt +++ b/sosc/sosc.rkt @@ -1,7 +1,5 @@ #lang racket - - (require rnrs rhs/rhs @@ -522,6 +520,30 @@ (verify-bundle p)))) + +(module+ test + (require rackunit) + + ;; test from Clement's osc package (osc-to-bytes.rkt) + ;; in sosc, strings are just "abc", blobs are #"abc". + ;; in osc, strings are #"abc", blobs are ('blob #"abc") + (check-equal? (encode-osc (message "/abc/def" + (list + 3 6 2.278 + "froggy" + #"derple"))) + (bytes-append + #"/abc/def\000\000\000\000,iifsb\0\0" + (bytes 0 0 0 3) + (bytes 0 0 0 6) + #"@\21\312\301" + #"froggy\0\0" + (bytes 0 0 0 6) + #"derple" + (bytes 0 0))) + + + ) #|