diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-09-05 21:10:05 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-09-05 21:10:05 +0000 |
commit | 912207fe0fa25d21837ced09dcd689c68e449ef7 (patch) | |
tree | 47f7ebb10e813987b9989ce70efc62cdbe451da8 /src/unit/string.unit | |
parent | e5f2e1ce7faeb8fb4609f7291e77d5b682685057 (diff) | |
download | libbu++-912207fe0fa25d21837ced09dcd689c68e449ef7.tar.gz libbu++-912207fe0fa25d21837ced09dcd689c68e449ef7.tar.bz2 libbu++-912207fe0fa25d21837ced09dcd689c68e449ef7.tar.xz libbu++-912207fe0fa25d21837ced09dcd689c68e449ef7.zip |
Added extra formatting argument indexing method to Bu::String::FormatProxy.
You can now use %{3} so that arguments can be followed by a digit.
Diffstat (limited to 'src/unit/string.unit')
-rw-r--r-- | src/unit/string.unit | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/unit/string.unit b/src/unit/string.unit index dfa0c38..4ea878e 100644 --- a/src/unit/string.unit +++ b/src/unit/string.unit | |||
@@ -581,6 +581,11 @@ suite String | |||
581 | unitTest( (Bu::String)Bu::String("%1%2").arg("IQ").arg(4, Bu::Fmt().plus()) == "IQ+4" ); | 581 | unitTest( (Bu::String)Bu::String("%1%2").arg("IQ").arg(4, Bu::Fmt().plus()) == "IQ+4" ); |
582 | unitTest( (Bu::String)Bu::String("Sup #%1-Guy!").arg( 1 ) == "Sup #1-Guy!" ); | 582 | unitTest( (Bu::String)Bu::String("Sup #%1-Guy!").arg( 1 ) == "Sup #1-Guy!" ); |
583 | } | 583 | } |
584 | |||
585 | test format2 | ||
586 | { | ||
587 | unitTest( Bu::String("0x%{1}00").arg( 75, Bu::Fmt::hex() ).end() == "0x4B00" ); | ||
588 | } | ||
584 | } | 589 | } |
585 | // 03F09CA4F58AC8CA0E80F0D9D409D0A60700A192270004BC3A99E91D0001034F544603362E35013103313130019CA4F58AC8CA0E0002830800002C4200008AC200EBF7D9D4090127BB010000E3 | 590 | // 03F09CA4F58AC8CA0E80F0D9D409D0A60700A192270004BC3A99E91D0001034F544603362E35013103313130019CA4F58AC8CA0E0002830800002C4200008AC200EBF7D9D4090127BB010000E3 |
586 | // | 591 | // |