Files
bbs/internal/server/marvelconfig_test.go
T
Claude 2c9fbd0b9a Add MSN Classic: The Microsoft Network for the Windows 95 client
internal/marvel serves the MSN client of 1995 to 1998 over its own
protocol (Marvel), by modem (frontend = marvel on a telnet or raw
listener) or over TCP ([marvel], port 569):

- the serial link (byte stuffing, CRC-32, Go-Back-N with a 16-packet
  window and retransmission) and the TCP "straight" records
- pipes, MPC host blocks and tagged parameters, property records
- LOGSRV: sign-in with BBS accounts (as a node), password change, the
  billing pages' name and address
- DIRSRV: MSN Central, Categories (a folder per area group), MSN Today
  (the boards with the newest posts), Go words, icons drawn here
- the BBS service: each readable message area is an MSN bulletin board,
  its messages listed with their reply threading, opened as articles,
  posted and replied to from the Compose window (plain, RTF or
  compressed RTF, kept as plain text) and deleted by their author

Written from the marvel-msn project's protocol notes and wire captures;
none of its code is used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSzB4EzF1cUBt1ccvB
2026-11-09 02:54:49 +00:00

38 lines
1.2 KiB
Go

package server
import (
"os"
"path/filepath"
"strings"
"testing"
)
// TestMarvelConfig: [marvel] listens on 569 by default, and a listener's
// frontend = marvel is for telnet and raw lines.
func TestMarvelConfig(t *testing.T) {
load := func(body string) (*Config, error) {
p := filepath.Join(t.TempDir(), "bbs.conf")
os.WriteFile(p, []byte(body), 0600)
return Load(p)
}
c, err := load("[listen msn]\ntype = raw\naddress = 127.0.0.1:2325\nfrontend = marvel\n[marvel]\n")
if err != nil {
t.Fatal(err)
}
if c.Marvel == nil || c.Marvel.Address != ":569" || c.Marvel.MaxClients != 64 {
t.Errorf("marvel %+v", c.Marvel)
}
if len(c.Listeners) != 1 || c.Listeners[0].Frontend != "marvel" {
t.Errorf("listener %+v", c.Listeners)
}
for body, want := range map[string]string{
"[marvel]\naddress = nowhere\n": "address",
"[listen x]\ntype = ssh\naddress = :2222\nfrontend = marvel\n": "frontend",
"[listen x]\ntype = raw\naddress = :2222\nfrontend = marvel\nconnect = 9600\n": "connect",
} {
if _, err := load(body); err == nil || !strings.Contains(err.Error(), want) {
t.Errorf("%q: %v", body, err)
}
}
}