max / audiofiles
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
- Claude-Session
- https://claude.ai/code/session_01EEmeiSJnmyL98QzA5Dwsvz
1 file changed,
+9 insertions,
-1 deletion
| @@ -17,7 +17,9 @@ | |||
| 17 | 17 | //! - `DELETE FROM samples` (a write, not a read). | |
| 18 | 18 | //! - The `CREATE VIEW live_samples` definition itself. | |
| 19 | 19 | //! - `#[cfg(test)]` modules (they legitimately assert raw table state). This | |
| 20 | - | //! assumes the repo convention of test modules at file end. | |
| 20 | + | //! assumes the repo convention of test modules at file end, and covers both | |
| 21 | + | //! forms that convention takes: an inline module, and a `tests.rs` sibling | |
| 22 | + | //! declared by `#[cfg(test)] mod tests;`. | |
| 21 | 23 | ||
| 22 | 24 | use std::fs; | |
| 23 | 25 | use std::path::{Path, PathBuf}; | |
| @@ -55,6 +57,12 @@ | |||
| 55 | 57 | if path.extension().and_then(|e| e.to_str()) != Some("rs") { | |
| 56 | 58 | continue; | |
| 57 | 59 | } | |
| 60 | + | // A module's tests may sit inline or in a `tests.rs` beside it. Both | |
| 61 | + | // read raw rows legitimately, so the sibling is skipped here for the | |
| 62 | + | // same reason the inline module is cut off below. | |
| 63 | + | if path.file_name().and_then(|n| n.to_str()) == Some("tests.rs") { | |
| 64 | + | continue; | |
| 65 | + | } | |
| 58 | 66 | let text = fs::read_to_string(&path).unwrap(); | |
| 59 | 67 | let lines: Vec<&str> = text.lines().collect(); | |
| 60 | 68 | // Test modules (conventionally at file end) legitimately read raw rows. |