Commit 01f36192 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Extra tests for string2ll

parent 6e258c76
...@@ -333,6 +333,14 @@ void test_string2ll(void) { ...@@ -333,6 +333,14 @@ void test_string2ll(void) {
strcpy(buf,"+1"); strcpy(buf,"+1");
assert(string2ll(buf,strlen(buf),&v) == 0); assert(string2ll(buf,strlen(buf),&v) == 0);
/* Leading space. */
strcpy(buf," 1");
assert(string2ll(buf,strlen(buf),&v) == 0);
/* Trailing space. */
strcpy(buf,"1 ");
assert(string2ll(buf,strlen(buf),&v) == 0);
/* May not start with 0. */ /* May not start with 0. */
strcpy(buf,"01"); strcpy(buf,"01");
assert(string2ll(buf,strlen(buf),&v) == 0); assert(string2ll(buf,strlen(buf),&v) == 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment