1 ! Copyright (C) 2007 Alex Chapman
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays morse strings tools.test ;
5 [ "" ] [ CHAR: \\ ch>morse ] unit-test
6 [ "..." ] [ CHAR: s ch>morse ] unit-test
7 [ CHAR: s ] [ "..." morse>ch ] unit-test
8 [ f ] [ "..--..--.." morse>ch ] unit-test
9 [ "-- --- .-. ... . / -.-. --- -.. ." ] [ "morse code" >morse ] unit-test
10 [ "morse code" ] [ "-- --- .-. ... . / -.-. --- -.. ." morse> ] unit-test
11 [ "hello, world!" ] [ "Hello, World!" >morse morse> ] unit-test
12 ! [ ] [ "sos" 0.075 play-as-morse* ] unit-test
13 ! [ ] [ "Factor rocks!" play-as-morse ] unit-test