aboutsummaryrefslogtreecommitdiff
path: root/tests/common/mod.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-12 13:01:22 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-12 13:01:22 +0100
commitc1e7f7264a68533262bfe1d181061e577e508030 (patch)
treeef33837aaa49c7cc06486a417d1ede37c0847ef1 /tests/common/mod.rs
parent69632879865bb351373c86daa1585942b8505618 (diff)
downloadaerogramme-c1e7f7264a68533262bfe1d181061e577e508030.tar.gz
aerogramme-c1e7f7264a68533262bfe1d181061e577e508030.zip
fix a condstore bug
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>()?)
+}