Remove code comments
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
c522e3aa3e
commit
33fbe7d5fc
17 changed files with 18 additions and 335 deletions
|
|
@ -1,6 +1,3 @@
|
|||
//! Integration tests for config layering and `[network]` sections, exercising
|
||||
//! the public `rustbot::config::parse_str` (no filesystem or environment).
|
||||
|
||||
use rustbot::config::parse_str;
|
||||
|
||||
#[test]
|
||||
|
|
@ -10,7 +7,6 @@ fn flat_config_is_a_single_network() {
|
|||
assert_eq!(cfgs[0].server, "irc.example.org");
|
||||
assert_eq!(cfgs[0].nick, "flatbot");
|
||||
assert_eq!(cfgs[0].channels, vec!["#a", "#b"]);
|
||||
// The label defaults to the server host.
|
||||
assert_eq!(cfgs[0].name, "irc.example.org");
|
||||
}
|
||||
|
||||
|
|
@ -26,17 +22,17 @@ fn sections_inherit_top_level_defaults_and_override() {
|
|||
let libera = &cfgs[0];
|
||||
assert_eq!(libera.name, "libera");
|
||||
assert_eq!(libera.server, "irc.libera.chat");
|
||||
assert_eq!(libera.nick, "shared"); // inherited
|
||||
assert_eq!(libera.channels, vec!["#lobby"]); // inherited
|
||||
assert_eq!(libera.nick, "shared");
|
||||
assert_eq!(libera.channels, vec!["#lobby"]);
|
||||
assert!(libera.tls);
|
||||
assert_eq!(libera.port, 6697); // TLS-port convention applied per network
|
||||
assert_eq!(libera.port, 6697);
|
||||
|
||||
let oftc = &cfgs[1];
|
||||
assert_eq!(oftc.name, "oftc");
|
||||
assert_eq!(oftc.server, "irc.oftc.net");
|
||||
assert_eq!(oftc.nick, "other"); // overridden
|
||||
assert_eq!(oftc.channels, vec!["#oftc"]); // overridden
|
||||
assert!(!oftc.tls); // default
|
||||
assert_eq!(oftc.nick, "other");
|
||||
assert_eq!(oftc.channels, vec!["#oftc"]);
|
||||
assert!(!oftc.tls);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -48,8 +44,7 @@ fn a_section_may_rename_itself() {
|
|||
|
||||
#[test]
|
||||
fn comments_and_blanks_are_ignored() {
|
||||
// A lone commented/blank file yields the built-in default single network.
|
||||
let cfgs = parse_str("# comment\n; also\n\n \n");
|
||||
assert_eq!(cfgs.len(), 1);
|
||||
assert_eq!(cfgs[0].server, "irc.tchatou.fr"); // built-in default
|
||||
assert_eq!(cfgs[0].server, "irc.tchatou.fr");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue