mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Merge pull request #64870 from MarcusElg/naninfprinting3.x
[3.x] Improve string formatting (%f) for inf and nan
This commit is contained in:
@@ -638,6 +638,14 @@ bool test_28() {
|
||||
OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL");
|
||||
state = state && success;
|
||||
|
||||
// Real (infinity) left-padded
|
||||
format = "fish %11f frog";
|
||||
args.clear();
|
||||
args.push_back(INFINITY);
|
||||
output = format.sprintf(args, &error);
|
||||
success = (output == String("fish inf frog") && !error);
|
||||
state = state && success;
|
||||
|
||||
// Real right-padded
|
||||
format = "fish %-11f frog";
|
||||
args.clear();
|
||||
|
||||
Reference in New Issue
Block a user