MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / visit

Function visit

tests/integration/platform_stdlib.rs:170–188  ·  view source on GitHub ↗
(dir: &std::path::Path, failures: &mut Vec<String>)

Source from the content-addressed store, hash-verified

168 for entry in std::fs::read_dir(dir).expect("read programs/user tree") {
169 let entry = entry.expect("read programs/user entry");
170 let path = entry.path();
171 if path.is_dir() {
172 visit(&path, failures);
173 continue;
174 }
175 if path.extension().and_then(|ext| ext.to_str()) != Some("hll") {
176 continue;
177 }
178 let src = std::fs::read_to_string(&path).expect("read hll source");
179 for (idx, line) in src.lines().enumerate() {
180 if line.trim_start().starts_with("external ") {
181 failures.push(format!("{}:{}", path.display(), idx + 1));
182 }
183 }
184 }
185 }
186
187 let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("programs/user");
188 let mut failures = Vec::new();
189 visit(&root, &mut failures);
190 assert!(
191 failures.is_empty(),

Calls 2

pathMethod · 0.80
pushMethod · 0.80