1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//! RFC lifecycle and amendment tracking tests.
mod common;
use common::{init_project, normalize_output, run_commands, today};
/// Test: RFC amendment tracking with signature-based detection
#[test]
fn test_rfc_amendment_tracking() {
let temp_dir = init_project();
let date = today();
// Create RFC and clause
let setup = run_commands(
temp_dir.path(),
&[
&["rfc", "new", "Amendment Test RFC"],
&[
"clause",
"new",
"RFC-0001:C-AMEND-TEST",
"Amendment Test Clause",
"-s",
"Specification",
"-k",
"normative",
],
&[
"clause",
"edit",
"RFC-0001:C-AMEND-TEST",
"--text",
"Original text for amendment test.",
],
],
);
// Finalize and bump to set baseline signature
let baseline = run_commands(
temp_dir.path(),
&[
&["rfc", "finalize", "RFC-0001", "normative"],
&[
"rfc",
"bump",
"RFC-0001",
"--minor",
"--summary",
"Establish baseline with signature",
],
&["rfc", "list"],
],
);
// Edit clause to create amendment
let edit = run_commands(
temp_dir.path(),
&[&[
"clause",
"edit",
"RFC-0001:C-AMEND-TEST",
"--text",
"AMENDED text - content changed.",
]],
);
// List should show asterisk for amended RFC
let amended = run_commands(temp_dir.path(), &[&["rfc", "list"]]);
// Bump version to release amendment
let released = run_commands(
temp_dir.path(),
&[
&[
"rfc",
"bump",
"RFC-0001",
"--patch",
"--summary",
"Release amendment",
],
&["rfc", "list"],
],
);
let combined = format!("{}{}{}{}{}", setup, baseline, edit, amended, released);
insta::assert_snapshot!(normalize_output(&combined, temp_dir.path(), &date));
}