mirror of
https://github.com/D-Modem/bbs.git
synced 2026-11-28 17:38:04 -08:00
GO CB asks a handle (not another member's name) and a channel; channel n is the chat room cb-n, shared with the BBS's other chat callers. The 1982 /HELP's commands: /TUN, /MON, /UNM, /STA, /TIM, /UST (the 1986 table, with s for scrambled and Tlk), /WHO, /HAN, /SCR, /SMC, /XCL, /UNS, /SQU, /JOB, /EXI, plus /TALK, /ROLL and /OFF. Lines show as (Handle) text, or (ch,Handle) from a monitored channel. Chat events carry the sender's handle (bbs.Node.SetHandle) beside their name, so other front ends still show the name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRRPWCkk1Ro91AuzXFM
21 lines
445 B
Go
21 lines
445 B
Go
package cis
|
|
|
|
import "testing"
|
|
|
|
func TestScramble(t *testing.T) {
|
|
text := "Hello, CB! 123"
|
|
s := scramble("xyz", text)
|
|
if s == text || len(s) != len(text) || s[5] != ',' && s[6] != ' ' {
|
|
t.Errorf("scrambled %q", s)
|
|
}
|
|
if s[6] != ' ' {
|
|
t.Errorf("spaces are kept: %q", s)
|
|
}
|
|
if u := unscramble("XYZ", s); u != text {
|
|
t.Errorf("unscrambled %q", u)
|
|
}
|
|
if u := unscramble("abc", s); u == text {
|
|
t.Error("another key unscrambled it")
|
|
}
|
|
}
|