From 69d1606ac97547896a0ede8dee5e59fc4a5de7c2 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 5 Sep 2012 19:29:29 +0000 Subject: Fixed silly bug involving juxtaposed replacement tokens in Bu::String::FormatProxy substitutions. --- src/unit/string.unit | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/unit') diff --git a/src/unit/string.unit b/src/unit/string.unit index acef0d5..dfa0c38 100644 --- a/src/unit/string.unit +++ b/src/unit/string.unit @@ -573,6 +573,14 @@ suite String unitTest( Bu::String(" \tHello \t\t\r\nthere\r\n \t").trimWhitespace() == "Hello \t\t\r\nthere" ); } + + test format1 + { + unitTest( (Bu::String)Bu::String("%1").arg( 12, Bu::Fmt().width(3) ) == " 12" ); + unitTest( (Bu::String)Bu::String("%1 %2").arg("IQ").arg(4, Bu::Fmt().plus()) == "IQ +4" ); + unitTest( (Bu::String)Bu::String("%1%2").arg("IQ").arg(4, Bu::Fmt().plus()) == "IQ+4" ); + unitTest( (Bu::String)Bu::String("Sup #%1-Guy!").arg( 1 ) == "Sup #1-Guy!" ); + } } // 03F09CA4F58AC8CA0E80F0D9D409D0A60700A192270004BC3A99E91D0001034F544603362E35013103313130019CA4F58AC8CA0E0002830800002C4200008AC200EBF7D9D4090127BB010000E3 // -- cgit v1.2.3