mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-01 19:38:06 +03:00
Fix bug in S_MOD
This commit is contained in:
@@ -471,6 +471,7 @@ struct string *string_format(struct string *fmt, union vm_value arg)
|
||||
parse_fmt_spec(&s, &spec);
|
||||
append_fmt(&out, &spec, arg);
|
||||
string_append_cstr(&out, s, strlen(s));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
|
||||
@@ -72,6 +72,7 @@ void test_strings(void)
|
||||
test_string("abc%Ddef % 42", "abc%Ddef" % 42, "abc42def");
|
||||
test_string("abc%4Ddef % 42", "abc%4Ddef" % 42, "abc 42def");
|
||||
test_string("abc%04Ddef % 42", "abc%04Ddef" % 42, "abc0042def");
|
||||
test_string("\"%d %d\" % 42 % 43", "%d %d" % 42 % 43, "42 43");
|
||||
// float
|
||||
test_string("abc%fdef % 12.3", "abc%fdef" % 12.3, "abc12.300000def");
|
||||
test_string("abc%.2fdef % 12.3", "abc%.2fdef" % 12.3, "abc12.30def");
|
||||
|
||||
Reference in New Issue
Block a user