mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Fix duplicate minus in print output.
Co-authored-by: kleonc <9283098+kleonc@users.noreply.github.com>
This commit is contained in:
@@ -992,6 +992,38 @@ TEST_CASE("[String] sprintf") {
|
||||
REQUIRE(error == false);
|
||||
CHECK(output == String("fish 143 frog"));
|
||||
|
||||
// INT64_MIN
|
||||
format = "fish %d frog";
|
||||
args.clear();
|
||||
args.push_back(INT64_MIN);
|
||||
output = format.sprintf(args, &error);
|
||||
REQUIRE(error == false);
|
||||
CHECK(output == String("fish -9223372036854775808 frog"));
|
||||
|
||||
// INT64_MIN hex (lower)
|
||||
format = "fish %x frog";
|
||||
args.clear();
|
||||
args.push_back(INT64_MIN);
|
||||
output = format.sprintf(args, &error);
|
||||
REQUIRE(error == false);
|
||||
CHECK(output == String("fish -8000000000000000 frog"));
|
||||
|
||||
// INT64_MIN hex (upper)
|
||||
format = "fish %X frog";
|
||||
args.clear();
|
||||
args.push_back(INT64_MIN);
|
||||
output = format.sprintf(args, &error);
|
||||
REQUIRE(error == false);
|
||||
CHECK(output == String("fish -8000000000000000 frog"));
|
||||
|
||||
// INT64_MIN octal
|
||||
format = "fish %o frog";
|
||||
args.clear();
|
||||
args.push_back(INT64_MIN);
|
||||
output = format.sprintf(args, &error);
|
||||
REQUIRE(error == false);
|
||||
CHECK(output == String("fish -1000000000000000000000 frog"));
|
||||
|
||||
///// Reals
|
||||
|
||||
// Real
|
||||
|
||||
Reference in New Issue
Block a user