summaryrefslogtreecommitdiff
path: root/src/tests/print.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/print.cpp')
-rw-r--r--src/tests/print.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/tests/print.cpp b/src/tests/print.cpp
index 0f9be6b..c6fe053 100644
--- a/src/tests/print.cpp
+++ b/src/tests/print.cpp
@@ -1,16 +1,31 @@
1#include <bu/sio.h> 1#include <bu/sio.h>
2 2
3int upper()
4{
5 static int iVal = 1;
6 return iVal++;
7}
8
3int main() 9int main()
4{ 10{
5 Bu::print("hello there %1!\n").arg("Bob"); 11 Bu::print("hello there %1!\n").arg("Bob");
6 12
7 Bu::println("This is %1 crazy, like %2 times over!"). 13 Bu::println("This is %1 crazy, like %2 times over!").
8 arg("totally").arg( 47.2 ); 14 arg("totally").arg( 47.2 ).end();
9 Bu::println("This is unsubstituted?"); 15 Bu::println("This is unsubstituted?");
10 16
11 Bu::serr << "This is error text." << Bu::serr.nl; 17 Bu::serr << "This is error text." << Bu::serr.nl;
12 Bu::println( Bu::serr, "This is also error text?"); 18 Bu::println( Bu::serr, "This is also error text?");
13 19
20 Bu::println("This is %{1}000 - %{1}.").arg( 34, Bu::Fmt().width(10).fill('0') );
21
22 Bu::String s = Bu::String("hello %1").arg("bob %1").end().toLower().arg("yo");
23
24 Bu::println( s );
25 Bu::println("Hello %%1");
26
27 Bu::println("Nums: %1, %2, %3, %4, %5, %6").arg( upper() ).arg( upper() ).arg( upper() ).arg( upper() ).arg( upper() ).arg( upper() );
28
14 return 0; 29 return 0;
15} 30}
16 31