summaryrefslogtreecommitdiff
path: root/src/or/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/test.c')
-rw-r--r--src/or/test.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 46f717e893..ff05b1dafb 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -2796,6 +2796,11 @@ test_util_sscanf(void)
test_eq(u1, 12u);
test_eq(u2, 3u);
test_eq(u3, 99u);
+
+ r = tor_sscanf("99% fresh", "%3u%% fresh", &u1); /* percents are scannable.*/
+ test_eq(r, 1);
+ test_eq(u1, 99);
+
r = tor_sscanf("hello", "%s", s1); /* %s needs a number. */
test_eq(r, -1);