Skip to content

Commit

Permalink
Nix iserver tests, since I can't figure out how to get them to work.
Browse files Browse the repository at this point in the history
OK, obviously I need to preare a "test" incubot server, with a corpus
that the test itself preloads.  But I'm too lazy to do that.
  • Loading branch information
offby1 committed Jun 8, 2011
1 parent 963e648 commit 6e2aaab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
2 changes: 1 addition & 1 deletion crude-test-runner.sh
Expand Up @@ -2,7 +2,7 @@

# Sure be nice if there were a built-in way to run all the tests ...

(echo incubot.rkt; echo iserver.rkt ; egrep -l '(scheme|rack)unit' *.rkt) | while read f
(echo incubot.rkt; egrep -l '(scheme|rack)unit' *.rkt) | while read f
do
if [ -x $f ]
then
Expand Down
29 changes: 0 additions & 29 deletions iserver.rkt 100755 → 100644
@@ -1,9 +1,3 @@
#! /bin/sh
#| Hey Emacs, this is -*-scheme-*- code!
#$Id$
exec racket -l errortrace --require "$0" --main -- ${1+"$@"}
|#

#lang racket

(require
Expand Down Expand Up @@ -72,26 +66,3 @@ exec racket -l errortrace --require "$0" --main -- ${1+"$@"}
(lambda (command-sym inp)
(channel-put *to-server* (cons command-sym inp))
(channel-get *from-server*)))]))

(provide main)
(define (main . args)
(parameterize
([*incubot-logger* (curry fprintf (current-error-port))])
(let ([s (make-incubot-server
(open-input-string
(string-append
"#s(utterance \"2010-01-19T03:01:31Z\" \"offby1\" \"##cinema\" \"Let's make hamsters race\")"
"\n"
"#s(utterance \"2010-01-19T03:01:31Z\" \"offby1\" \"##cinema\" \"Gimme some dough\")")
))])
(define (get input) (s 'get input))
(define (put sentence) (s 'put sentence))

(define (try input) (printf "~a => ~s~%" input (time (get input))))

(try "Oh shit")
(try "Oops, ate too much cookie dough")
(try "OOPS, ATE TOO MUCH COOKIE DOUGH")
(put "What is all this shit?")
(try "hamsters")
(try "Oh shit"))))

0 comments on commit 6e2aaab

Please sign in to comment.