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 { CHAR: \s } [ "..--..--.." 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 { ".- -... -.-." } [ "abc" >morse ] unit-test
14 { "abc" } [ ".- -... -.-." morse> ] unit-test
20 MORSE] >morse morse> ] unit-test
22 { "morse code 123" } [
33 "morse code" >morse morse>
38 ..-. .- -.-. - --- .-. /
39 .-. --- -.-. -.- ... -.-.--
41 ! [ ] [ "sos" 0.075 play-as-morse* ] unit-test
42 ! [ ] [ "Factor rocks!" play-as-morse ] unit-test
43 ! [ ] [ "\n" play-as-morse ] unit-test