File tree Expand file tree Collapse file tree
impl/rust-cli/fuzz/fuzz_targets Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111#![ no_main]
1212
1313use libfuzzer_sys:: fuzz_target;
14+ use tempfile:: TempDir ;
1415use vsh:: glob:: expand_glob;
1516
1617fuzz_target ! ( |data: & [ u8 ] | {
@@ -33,12 +34,18 @@ fuzz_target!(|data: &[u8]| {
3334 return ;
3435 }
3536
37+ // Create temporary directory for glob expansion
38+ let temp = match TempDir :: new( ) {
39+ Ok ( t) => t,
40+ Err ( _) => return ,
41+ } ;
42+
3643 // Expand glob (should complete quickly or return error)
3744 // Should NEVER:
3845 // - Hang (exponential backtracking)
3946 // - Panic
4047 // - Use excessive memory
41- let _ = expand_glob( pattern) ;
48+ let _ = expand_glob( pattern, temp . path ( ) ) ;
4249
4350 // Test cases include:
4451 // - Simple wildcards: *.txt, file?.rs
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fuzz_target!(|data: &[u8]| {
3535 Err ( _) => return ,
3636 } ;
3737
38- let mut state = match ShellState :: new( temp. path( ) ) {
38+ let mut state = match ShellState :: new( temp. path( ) . to_str ( ) . unwrap ( ) ) {
3939 Ok ( s) => s,
4040 Err ( _) => return ,
4141 } ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ fuzz_target!(|data: &[u8]| {
5151 Err ( _) => return ,
5252 } ;
5353
54- let mut state = match ShellState :: new( temp. path( ) ) {
54+ let mut state = match ShellState :: new( temp. path( ) . to_str ( ) . unwrap ( ) ) {
5555 Ok ( s) => s,
5656 Err ( _) => return ,
5757 } ;
@@ -75,7 +75,7 @@ fuzz_target!(|data: &[u8]| {
7575 let _ = rm( & mut state, & target, true ) ;
7676 }
7777 Action :: Undo => {
78- let _ = state. pop_undo ( ) ;
78+ let _ = state. pop_redo ( ) ;
7979 }
8080 Action :: Redo => {
8181 let _ = state. pop_redo( ) ;
@@ -95,7 +95,7 @@ fuzz_target!(|data: &[u8]| {
9595 . map( |e| e. count( ) )
9696 . unwrap_or( 0 ) ;
9797
98- while state. pop_undo ( ) . is_ok( ) {
98+ while state. pop_redo ( ) . is_ok( ) {
9999 // Keep undoing
100100 }
101101
Original file line number Diff line number Diff line change 11/- Valence Shell - Filesystem Model (Lean 4)
22
3- A formal model of POSIX-like filesystem operations for proving
4- MAA (Mutually Assured Accountability) properties.
3+ A formal model of POSIX-like filesystem operations for proving
4+ MAA (Mutually Assured Accountability) properties.
55
6- This model focuses on directory operations (mkdir/rmdir) with
7- the goal of proving reversibility and correctness properties.
6+ This model focuses on directory operations (mkdir/rmdir) with
7+ the goal of proving reversibility and correctness properties.
88-/
99
1010-- Path Model
@@ -94,6 +94,7 @@ theorem nonempty_path_ne_parent (p : Path) (h : p ≠ []) :
9494 have hp2 : p.reverse = x :: rest := hp
9595 rw [heq] at hp2
9696 simp at hp2
97+ contradiction
9798
9899theorem pathExists_emptyFS_root :
99100 pathExists rootPath emptyFS := by
You can’t perform that action at this time.
0 commit comments