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
78 lines
2.2 KiB
Go
78 lines
2.2 KiB
Go
package server
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/D-Modem/bbs/internal/ui3270"
|
|
)
|
|
|
|
// TestCompuServeCB: two callers on the CB Simulator: handles, a channel,
|
|
// /UST, a monitored channel, scrambling and /EXI.
|
|
func TestCompuServeCB(t *testing.T) {
|
|
e := startFull(t, ui3270.Graphics{}, nil, nil, cisListener())
|
|
|
|
a := cisLogin(e, "72000,1", "alicepass1")
|
|
a.send("GO CB\r")
|
|
a.expect("CompuServe CB Simulator")
|
|
a.expect("What's your handle? ")
|
|
a.send("sysop\r")
|
|
a.expect("That handle is another member's name.")
|
|
a.expect("What's your handle? ")
|
|
a.send("Red Leather\r")
|
|
a.expect("What channel (1-36)? ")
|
|
a.send("17\r")
|
|
a.expect("(Tuned to channel 17, 0 others here)\r\n")
|
|
|
|
b := cisLogin(e, "72000,2", "sysoppass1")
|
|
b.send("GO CB\r")
|
|
b.expect("What's your handle? ")
|
|
b.send("Old Man\r")
|
|
b.expect("What channel (1-36)? ")
|
|
b.send("\r")
|
|
b.expect("(Tuned to channel 1, 0 others here)\r\n")
|
|
b.send("/MON 17\r")
|
|
b.expect("Monitoring channels 17\r\n")
|
|
|
|
a.send("Does anyone know what time it is?\r")
|
|
b.expect("(17,Red Leather) Does anyone know what time it is?\r\n")
|
|
b.send("/TUN 17\r")
|
|
b.expect("(Tuned to channel 17, 1 other here)\r\n")
|
|
a.expect("** Old Man tuned in to channel 17 **\r\n")
|
|
b.send("Time for CB.\r")
|
|
a.expect("(Old Man) Time for CB.\r\n")
|
|
a.send("/WHO\r")
|
|
a.expect("72000,2\r\n")
|
|
a.send("/UST\r")
|
|
a.expect(" Job User Id Ch. Node Handle\r\n --- ---------- --- ---- ------\r\n")
|
|
a.expect(" 72000,1 17 ")
|
|
a.expect("Red Leather\r\n")
|
|
a.expect(" 72000,2 17 ")
|
|
a.expect("Old Man\r\n")
|
|
|
|
// scrambled: clear to the same key, garbage to the rest
|
|
a.send("/SCR secret\r")
|
|
a.expect("Scrambled\r\n")
|
|
a.send("meet at noon\r")
|
|
b.expect("(Red Leather) ")
|
|
b.expect("\r\n")
|
|
if got := string(b.before); strings.Contains(got, "meet") {
|
|
t.Errorf("unscrambled without the key: %q", got)
|
|
}
|
|
b.send("/SCR secret\r")
|
|
b.expect("Scrambled\r\n")
|
|
a.send("meet at noon\r")
|
|
b.expect("(Red Leather) meet at noon\r\n")
|
|
a.send("/UST 17\r")
|
|
a.expect(" 17s ")
|
|
|
|
b.send("/EXI\r")
|
|
b.expect("Thank you for using CB.")
|
|
b.expect("Enter choice !")
|
|
a.expect("** Old Man left channel 17 **")
|
|
a.send("/OFF\r")
|
|
a.expect("Thank you for using CompuServe!")
|
|
b.send("OFF\r")
|
|
b.expect("Thank you for using CompuServe!")
|
|
}
|