1 ! Copyright (C) 2007 Alex Chapman
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays morse strings tools.test ;
6 [ "?" ] [ CHAR: \\ ch>morse ] unit-test
7 [ "..." ] [ CHAR: s ch>morse ] unit-test
8 [ CHAR: s ] [ "..." morse>ch ] unit-test
9 [ CHAR: \s ] [ "..--..--.." morse>ch ] unit-test
10 [ "-- --- .-. ... . / -.-. --- -.. ." ] [ "morse code" >morse ] unit-test
11 [ "morse code" ] [ "-- --- .-. ... . / -.-. --- -.. ." morse> ] unit-test
12 [ "hello, world!" ] [ "Hello, World!" >morse morse> ] unit-test
13 [ ".- -... -.-." ] [ "abc" >morse ] unit-test
15 [ "abc" ] [ ".- -... -.-." morse> ] unit-test
21 MORSE] >morse morse> ] unit-test
23 [ "morse code 123" ] [
34 "morse code" >morse morse>
39 ..-. .- -.-. - --- .-. /
40 .-. --- -.-. -.- ... -.-.--
42 ! [ ] [ "sos" 0.075 play-as-morse* ] unit-test
43 ! [ ] [ "Factor rocks!" play-as-morse ] unit-test
44 ! [ ] [ "\n" play-as-morse ] unit-test