mcplint 0.4.0

MCP Server Testing, Fuzzing, and Security Scanning Platform
Documentation
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
//! Contextual help system with recipes and guided workflows
//!
//! Provides interactive help recipes for common tasks and troubleshooting.

use crate::ui::{OutputMode, Printer};
use std::collections::HashMap;

/// A step in a help recipe
#[derive(Debug, Clone)]
pub struct Step {
    /// Description of what this step does
    pub description: String,
    /// Command to run
    pub command: String,
    /// Optional note or explanation
    pub note: Option<String>,
}

impl Step {
    pub fn new(description: impl Into<String>, command: impl Into<String>) -> Self {
        Self {
            description: description.into(),
            command: command.into(),
            note: None,
        }
    }

    pub fn with_note(mut self, note: impl Into<String>) -> Self {
        self.note = Some(note.into());
        self
    }
}

/// A help recipe - a guided workflow for a common task
#[derive(Debug, Clone)]
pub struct Recipe {
    /// Recipe title
    pub title: String,
    /// Short description
    pub description: String,
    /// Steps in the recipe
    pub steps: Vec<Step>,
    /// Related recipes
    pub see_also: Vec<String>,
    /// Tags for searching
    pub tags: Vec<String>,
}

impl Recipe {
    pub fn new(title: impl Into<String>, description: impl Into<String>) -> Self {
        Self {
            title: title.into(),
            description: description.into(),
            steps: Vec::new(),
            see_also: Vec::new(),
            tags: Vec::new(),
        }
    }

    pub fn add_step(mut self, step: Step) -> Self {
        self.steps.push(step);
        self
    }

    pub fn see_also(mut self, recipe: impl Into<String>) -> Self {
        self.see_also.push(recipe.into());
        self
    }

    pub fn tag(mut self, tag: impl Into<String>) -> Self {
        self.tags.push(tag.into());
        self
    }
}

/// The help system containing all recipes
pub struct HelpSystem {
    recipes: HashMap<String, Recipe>,
}

impl Default for HelpSystem {
    fn default() -> Self {
        Self::new()
    }
}

impl HelpSystem {
    /// Create a new help system with built-in recipes
    pub fn new() -> Self {
        let mut recipes = HashMap::new();

        // First scan recipe
        recipes.insert(
            "first-scan".to_string(),
            Recipe::new(
                "Running Your First Security Scan",
                "Get started with mcplint security scanning",
            )
            .add_step(Step::new(
                "Check your environment is set up correctly",
                "mcplint doctor",
            ))
            .add_step(Step::new("List available MCP servers", "mcplint servers"))
            .add_step(Step::new(
                "Run a quick security scan",
                "mcplint scan <server-name> --profile quick",
            ))
            .add_step(
                Step::new(
                    "View detailed results with JSON output",
                    "mcplint scan <server-name> --format json",
                )
                .with_note("Replace <server-name> with a server from step 2"),
            )
            .see_also("test-authentication")
            .see_also("ci-integration")
            .tag("getting-started")
            .tag("scan"),
        );

        // Test authentication recipe
        recipes.insert(
            "test-authentication".to_string(),
            Recipe::new(
                "Testing Authentication Security",
                "Comprehensive authentication testing workflow",
            )
            .add_step(Step::new(
                "Run focused auth scan with all rules",
                "mcplint scan <server> --include SEC --profile intensive",
            ))
            .add_step(Step::new(
                "Check specific security rules",
                "mcplint rules --category security --details",
            ))
            .add_step(Step::new(
                "Generate a SARIF report for review",
                "mcplint scan <server> --format sarif --output auth-report.sarif",
            ))
            .add_step(
                Step::new(
                    "Save baseline for future comparison",
                    "mcplint scan <server> --save-baseline auth-baseline.json",
                )
                .with_note("Use baselines to track security improvements over time"),
            )
            .see_also("prevent-injection")
            .see_also("ci-integration")
            .tag("security")
            .tag("authentication"),
        );

        // Prevent injection recipe
        recipes.insert(
            "prevent-injection".to_string(),
            Recipe::new(
                "Preventing Injection Attacks",
                "How to detect and prevent injection vulnerabilities",
            )
            .add_step(Step::new(
                "Scan for injection vulnerabilities",
                "mcplint scan <server> --include injection --details",
            ))
            .add_step(Step::new(
                "Review tool schemas for dangerous patterns",
                "mcplint validate <server> --include TOOL",
            ))
            .add_step(Step::new(
                "Fuzz test parameter handling",
                "mcplint fuzz <server> --profile intensive --target-tools <tool-name>",
            ))
            .add_step(Step::new(
                "Get AI explanation of findings",
                "mcplint explain <server>",
            ))
            .see_also("test-authentication")
            .see_also("schema-validation")
            .tag("security")
            .tag("injection"),
        );

        // CI integration recipe
        recipes.insert(
            "ci-integration".to_string(),
            Recipe::new(
                "Setting Up CI/CD Integration",
                "Integrate mcplint into your CI/CD pipeline",
            )
            .add_step(
                Step::new("Generate a project configuration", "mcplint init")
                    .with_note("Creates .mcplint.toml with sensible defaults"),
            )
            .add_step(Step::new(
                "Test with CI-friendly output",
                "mcplint scan <server> --format sarif --fail-on high",
            ))
            .add_step(
                Step::new(
                    "Add to GitHub Actions",
                    "# .github/workflows/security.yml\n\
                     #   - uses: actions/checkout@v4\n\
                     #   - run: cargo install mcplint\n\
                     #   - run: mcplint scan <server> --format sarif",
                )
                .with_note("mcplint returns exit code 1 when issues are found"),
            )
            .add_step(Step::new(
                "Create a baseline for incremental scanning",
                "mcplint scan <server> --save-baseline baseline.json",
            ))
            .see_also("first-scan")
            .see_also("baseline-management")
            .tag("ci")
            .tag("automation"),
        );

        // Schema validation recipe
        recipes.insert(
            "schema-validation".to_string(),
            Recipe::new(
                "Validating Tool Schemas",
                "Ensure your MCP server schemas are correct and secure",
            )
            .add_step(Step::new(
                "Run protocol validation",
                "mcplint validate <server> --details",
            ))
            .add_step(Step::new(
                "Check schema-specific rules",
                "mcplint rules --category schema --details",
            ))
            .add_step(Step::new(
                "Generate tool fingerprints for tracking changes",
                "mcplint fingerprint generate <server>",
            ))
            .add_step(Step::new(
                "Compare with previous fingerprint",
                "mcplint fingerprint compare <server> --baseline fingerprint.json",
            ))
            .see_also("prevent-injection")
            .tag("schema")
            .tag("validation"),
        );

        // Baseline management recipe
        recipes.insert(
            "baseline-management".to_string(),
            Recipe::new(
                "Managing Security Baselines",
                "Track security improvements with baseline comparisons",
            )
            .add_step(Step::new(
                "Create an initial baseline",
                "mcplint scan <server> --save-baseline baseline.json",
            ))
            .add_step(Step::new(
                "Run a scan comparing to baseline",
                "mcplint scan <server> --baseline baseline.json",
            ))
            .add_step(
                Step::new(
                    "Update baseline after fixing issues",
                    "mcplint scan <server> --save-baseline baseline.json",
                )
                .with_note("Only update baseline after reviewing and fixing findings"),
            )
            .see_also("ci-integration")
            .tag("baseline")
            .tag("diff"),
        );

        // Fuzzing recipe
        recipes.insert(
            "fuzz-testing".to_string(),
            Recipe::new(
                "Fuzz Testing Your Server",
                "Find edge cases and crashes with coverage-guided fuzzing",
            )
            .add_step(Step::new(
                "Run a quick fuzz test",
                "mcplint fuzz <server> --profile quick",
            ))
            .add_step(Step::new(
                "Run intensive fuzzing for thorough testing",
                "mcplint fuzz <server> --profile intensive --iterations 10000",
            ))
            .add_step(Step::new(
                "Fuzz specific tools",
                "mcplint fuzz <server> --target-tools read_file,write_file",
            ))
            .add_step(
                Step::new(
                    "Save interesting inputs for reproduction",
                    "mcplint fuzz <server> --save-corpus ./corpus",
                )
                .with_note("Corpus contains inputs that triggered new behavior"),
            )
            .see_also("prevent-injection")
            .tag("fuzzing")
            .tag("testing"),
        );

        // Troubleshooting recipe
        recipes.insert(
            "troubleshooting".to_string(),
            Recipe::new(
                "Troubleshooting Common Issues",
                "Diagnose and fix common problems",
            )
            .add_step(Step::new(
                "Run environment diagnostics",
                "mcplint doctor --extended",
            ))
            .add_step(Step::new(
                "Check server configuration",
                "mcplint servers --details",
            ))
            .add_step(
                Step::new(
                    "Test with increased timeout",
                    "mcplint validate <server> --timeout 60",
                )
                .with_note("Some servers need longer startup time"),
            )
            .add_step(Step::new(
                "View verbose output for debugging",
                "RUST_LOG=debug mcplint validate <server>",
            ))
            .see_also("first-scan")
            .tag("troubleshooting")
            .tag("debug"),
        );

        Self { recipes }
    }

    /// Get a recipe by name
    pub fn get_recipe(&self, name: &str) -> Option<&Recipe> {
        self.recipes.get(name)
    }

    /// List all available recipes
    pub fn list_recipes(&self) -> Vec<(&String, &Recipe)> {
        let mut recipes: Vec<_> = self.recipes.iter().collect();
        recipes.sort_by(|a, b| a.0.cmp(b.0));
        recipes
    }

    /// Search recipes by tag or keyword
    pub fn search(&self, query: &str) -> Vec<(&String, &Recipe)> {
        let query_lower = query.to_lowercase();
        self.recipes
            .iter()
            .filter(|(name, recipe)| {
                name.contains(&query_lower)
                    || recipe.title.to_lowercase().contains(&query_lower)
                    || recipe.description.to_lowercase().contains(&query_lower)
                    || recipe.tags.iter().any(|t| t.contains(&query_lower))
            })
            .collect()
    }

    /// Display a recipe
    pub fn show_recipe(&self, name: &str, mode: OutputMode) {
        let printer = Printer::with_mode(mode);

        if let Some(recipe) = self.get_recipe(name) {
            printer.newline();

            // Title box
            if mode.unicode_enabled() {
                let title_line = format!(" {} ", recipe.title);
                let border = "─".repeat(title_line.len() + 2);
                printer.header(&format!("â•­{}â•®", border));
                printer.header(&format!("│ {} │", title_line));
                printer.header(&format!("╰{}╯", border));
            } else {
                printer.header(&format!("=== {} ===", recipe.title));
            }

            printer.newline();
            printer.println(&recipe.description);
            printer.newline();

            // Steps
            for (i, step) in recipe.steps.iter().enumerate() {
                let step_num = i + 1;

                if mode.unicode_enabled() {
                    printer.println(&format!("{}. {}", step_num, step.description));
                    printer.println(&format!("   → {}", step.command));
                } else {
                    printer.println(&format!("{}. {}", step_num, step.description));
                    printer.println(&format!("   $ {}", step.command));
                }

                if let Some(note) = &step.note {
                    if mode.colors_enabled() {
                        use colored::Colorize;
                        println!("   {}", format!("Note: {}", note).dimmed());
                    } else {
                        printer.println(&format!("   Note: {}", note));
                    }
                }
                printer.newline();
            }

            // See also
            if !recipe.see_also.is_empty() {
                printer.separator();
                printer.println("See also:");
                for related in &recipe.see_also {
                    if mode.unicode_enabled() {
                        printer.println(&format!("  • mcplint how-do-i {}", related));
                    } else {
                        printer.println(&format!("  - mcplint how-do-i {}", related));
                    }
                }
            }
        } else {
            // Recipe not found - suggest similar
            let available: Vec<_> = self.recipes.keys().map(|s| s.as_str()).collect();
            if let Some(suggestion) =
                crate::errors::suggestions::find_similar(name, &available, 0.5)
            {
                printer.error(&format!("Recipe '{}' not found.", name));
                printer.println(&format!("Did you mean '{}'?", suggestion));
            } else {
                printer.error(&format!("Recipe '{}' not found.", name));
                printer.println("Run 'mcplint how-do-i' to see available recipes.");
            }
        }
    }

    /// Display list of all recipes
    pub fn show_list(&self, mode: OutputMode) {
        let printer = Printer::with_mode(mode);

        printer.newline();
        printer.header("Available Help Recipes");
        printer.separator();
        printer.newline();

        for (name, recipe) in self.list_recipes() {
            let bullet = if mode.unicode_enabled() { "•" } else { "-" };
            printer.println(&format!("  {} {} - {}", bullet, name, recipe.description));
        }

        printer.newline();
        printer.println("Usage: mcplint how-do-i <recipe-name>");
        printer.println("       mcplint how-do-i --search <keyword>");
        printer.newline();
    }

    /// Display search results
    pub fn show_search_results(&self, query: &str, mode: OutputMode) {
        let printer = Printer::with_mode(mode);
        let results = self.search(query);

        printer.newline();
        if results.is_empty() {
            printer.println(&format!("No recipes found matching '{}'.", query));
            printer.println("Run 'mcplint how-do-i' to see all available recipes.");
        } else {
            printer.header(&format!("Recipes matching '{}':", query));
            printer.newline();

            for (name, recipe) in results {
                printer.println(&format!("  {} - {}", name, recipe.description));
            }

            printer.newline();
            printer.println("Usage: mcplint how-do-i <recipe-name>");
        }
        printer.newline();
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn help_system_has_recipes() {
        let help = HelpSystem::new();
        assert!(!help.recipes.is_empty());
    }

    #[test]
    fn get_recipe_returns_existing() {
        let help = HelpSystem::new();
        assert!(help.get_recipe("first-scan").is_some());
        assert!(help.get_recipe("test-authentication").is_some());
    }

    #[test]
    fn get_recipe_returns_none_for_unknown() {
        let help = HelpSystem::new();
        assert!(help.get_recipe("unknown-recipe").is_none());
    }

    #[test]
    fn list_recipes_returns_all() {
        let help = HelpSystem::new();
        let list = help.list_recipes();
        assert!(list.len() >= 5);
    }

    #[test]
    fn search_by_tag() {
        let help = HelpSystem::new();
        let results = help.search("security");
        assert!(!results.is_empty());
    }

    #[test]
    fn search_by_title() {
        let help = HelpSystem::new();
        let results = help.search("authentication");
        assert!(!results.is_empty());
    }

    #[test]
    fn search_no_results() {
        let help = HelpSystem::new();
        let results = help.search("xyznonexistent");
        assert!(results.is_empty());
    }

    #[test]
    fn recipe_has_steps() {
        let help = HelpSystem::new();
        let recipe = help.get_recipe("first-scan").unwrap();
        assert!(!recipe.steps.is_empty());
    }

    #[test]
    fn recipe_has_see_also() {
        let help = HelpSystem::new();
        let recipe = help.get_recipe("test-authentication").unwrap();
        assert!(!recipe.see_also.is_empty());
    }

    #[test]
    fn step_creation() {
        let step = Step::new("Test step", "test command").with_note("A note");
        assert_eq!(step.description, "Test step");
        assert_eq!(step.command, "test command");
        assert_eq!(step.note, Some("A note".to_string()));
    }

    #[test]
    fn recipe_builder() {
        let recipe = Recipe::new("Test", "A test recipe")
            .add_step(Step::new("Step 1", "cmd1"))
            .see_also("other")
            .tag("test");

        assert_eq!(recipe.title, "Test");
        assert_eq!(recipe.steps.len(), 1);
        assert_eq!(recipe.see_also, vec!["other"]);
        assert_eq!(recipe.tags, vec!["test"]);
    }

    #[test]
    fn show_recipe_with_existing_recipe_interactive_mode() {
        let help = HelpSystem::new();
        // Should not panic - testing with Interactive (unicode + colors)
        help.show_recipe("first-scan", OutputMode::Interactive);
    }

    #[test]
    fn show_recipe_with_existing_recipe_plain_mode() {
        let help = HelpSystem::new();
        // Should not panic - testing with Plain (no unicode, no colors)
        help.show_recipe("test-authentication", OutputMode::Plain);
    }

    #[test]
    fn show_recipe_with_existing_recipe_ci_mode() {
        let help = HelpSystem::new();
        // Should not panic - testing with CI mode
        help.show_recipe("prevent-injection", OutputMode::CI);
    }

    #[test]
    fn show_recipe_with_non_existent_recipe() {
        let help = HelpSystem::new();
        // Should not panic - tests error handling path
        help.show_recipe("non-existent-recipe", OutputMode::Plain);
    }

    #[test]
    fn show_recipe_with_non_existent_recipe_suggests_similar() {
        let help = HelpSystem::new();
        // Test with a name similar to an existing one to trigger suggestion path
        help.show_recipe("first-scam", OutputMode::Plain);
    }

    #[test]
    fn show_recipe_displays_steps_with_notes() {
        let help = HelpSystem::new();
        // Get a recipe with steps that have notes
        let recipe = help.get_recipe("ci-integration").unwrap();
        // Verify recipe has steps with notes
        assert!(recipe.steps.iter().any(|s| s.note.is_some()));
        // Should render without panic in different modes
        help.show_recipe("ci-integration", OutputMode::Interactive);
        help.show_recipe("ci-integration", OutputMode::Plain);
    }

    #[test]
    fn show_recipe_displays_see_also_section() {
        let help = HelpSystem::new();
        // Get a recipe with see_also references
        let recipe = help.get_recipe("test-authentication").unwrap();
        assert!(!recipe.see_also.is_empty());
        // Should render see_also section without panic
        help.show_recipe("test-authentication", OutputMode::Interactive);
        help.show_recipe("test-authentication", OutputMode::Plain);
    }

    #[test]
    fn show_list_does_not_panic_interactive() {
        let help = HelpSystem::new();
        // Should not panic with Interactive mode
        help.show_list(OutputMode::Interactive);
    }

    #[test]
    fn show_list_does_not_panic_plain() {
        let help = HelpSystem::new();
        // Should not panic with Plain mode
        help.show_list(OutputMode::Plain);
    }

    #[test]
    fn show_list_does_not_panic_ci() {
        let help = HelpSystem::new();
        // Should not panic with CI mode
        help.show_list(OutputMode::CI);
    }

    #[test]
    fn show_search_results_with_matches_interactive() {
        let help = HelpSystem::new();
        // Search for "security" should find matches
        help.show_search_results("security", OutputMode::Interactive);
    }

    #[test]
    fn show_search_results_with_matches_plain() {
        let help = HelpSystem::new();
        // Search for "fuzzing" should find matches
        help.show_search_results("fuzzing", OutputMode::Plain);
    }

    #[test]
    fn show_search_results_with_matches_ci() {
        let help = HelpSystem::new();
        // Search for "scan" should find matches
        help.show_search_results("scan", OutputMode::CI);
    }

    #[test]
    fn show_search_results_no_matches_interactive() {
        let help = HelpSystem::new();
        // Search for non-existent term should show no results message
        help.show_search_results("xyznonexistent", OutputMode::Interactive);
    }

    #[test]
    fn show_search_results_no_matches_plain() {
        let help = HelpSystem::new();
        // Search for non-existent term should show no results message
        help.show_search_results("impossiblequery", OutputMode::Plain);
    }

    #[test]
    fn show_search_results_no_matches_ci() {
        let help = HelpSystem::new();
        // Search for non-existent term should show no results message
        help.show_search_results("zzznotfound", OutputMode::CI);
    }

    #[test]
    fn help_system_default_creates_instance() {
        let help = HelpSystem::default();
        // Should create instance with all recipes
        assert!(!help.recipes.is_empty());
        assert!(help.get_recipe("first-scan").is_some());
    }

    #[test]
    fn output_modes_unicode_behavior() {
        // Test unicode_enabled for all modes
        assert!(OutputMode::Interactive.unicode_enabled());
        assert!(!OutputMode::Plain.unicode_enabled());
        assert!(!OutputMode::CI.unicode_enabled());
    }

    #[test]
    fn output_modes_colors_behavior() {
        // Test colors_enabled for all modes
        assert!(OutputMode::Interactive.colors_enabled());
        assert!(!OutputMode::Plain.colors_enabled());
        assert!(!OutputMode::CI.colors_enabled());
    }

    #[test]
    fn recipe_with_multiline_commands() {
        let help = HelpSystem::new();
        // ci-integration has a multiline command (GitHub Actions example)
        let recipe = help.get_recipe("ci-integration").unwrap();
        // Verify it has steps
        assert!(!recipe.steps.is_empty());
        // Should render without panic
        help.show_recipe("ci-integration", OutputMode::Plain);
    }

    #[test]
    fn all_recipes_are_searchable() {
        let help = HelpSystem::new();
        // Each recipe should be findable by its name
        for (name, _) in help.list_recipes() {
            let results = help.search(name);
            assert!(
                !results.is_empty(),
                "Recipe '{}' should be searchable",
                name
            );
        }
    }

    #[test]
    fn search_is_case_insensitive() {
        let help = HelpSystem::new();
        let lower = help.search("security");
        let upper = help.search("SECURITY");
        let mixed = help.search("SeCuRiTy");

        assert_eq!(lower.len(), upper.len());
        assert_eq!(lower.len(), mixed.len());
        assert!(!lower.is_empty());
    }

    #[test]
    fn step_without_note() {
        let step = Step::new("Test", "command");
        assert_eq!(step.description, "Test");
        assert_eq!(step.command, "command");
        assert_eq!(step.note, None);
    }
}