aboutsummaryrefslogtreecommitdiff
path: root/tests/common/mod.rs
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-01-15 07:07:06 +0000
committerQuentin <quentin@dufour.io>2024-01-15 07:07:06 +0000
commit55e26d24a08519ded6a6898453dcd6db287f45c8 (patch)
tree074d9f8dbc161d2aa8f59be26826b40c09d3d658 /tests/common/mod.rs
parentd49a2355f71fe555a67a815c31800f901a0d0a71 (diff)
parent81bfed3b7df354148f284ed4e3708c1a086d6e58 (diff)
downloadaerogramme-55e26d24a08519ded6a6898453dcd6db287f45c8.tar.gz
aerogramme-55e26d24a08519ded6a6898453dcd6db287f45c8.zip
Merge pull request 'CONDSTORE' (#71) from feat/condstore-try-2 into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/71
Diffstat (limited to 'tests/common/mod.rs')
-rw-r--r--tests/common/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 810fd79..cbe0271 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -88,3 +88,12 @@ pub fn read_lines<'a, F: Read>(
println!("read: {}", std::str::from_utf8(&buffer[..nbytes])?);
Ok(&buffer[..nbytes])
}
+
+pub fn read_first_u32(inp: &str) -> Result<u32> {
+ Ok(inp
+ .chars()
+ .skip_while(|c| !c.is_digit(10))
+ .take_while(|c| c.is_digit(10))
+ .collect::<String>()
+ .parse::<u32>()?)
+}