X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=basis%2Fformatting%2Fformatting-tests.factor;h=8b4bf16b12ca4bd947f012aaa12c125b06b887e0;hp=543eff4fdd182e61a94bd89a6df295a5ba8edabc;hb=1198695223596ff2306a3204a097c00fad1f1cdc;hpb=7c2e964fc9e86858724e740b0d1909b6162dde99 diff --git a/basis/formatting/formatting-tests.factor b/basis/formatting/formatting-tests.factor old mode 100755 new mode 100644 index 543eff4fdd..8b4bf16b12 --- a/basis/formatting/formatting-tests.factor +++ b/basis/formatting/formatting-tests.factor @@ -106,6 +106,9 @@ IN: formatting.tests { "9.877e+417" } [ 987654321098765432 10 400 ^ * "%.3e" sprintf ] unit-test { "9.88e+417" } [ 987654321098765432 10 400 ^ * "%.2e" sprintf ] unit-test { "9.9e+417" } [ 987654321098765432 10 400 ^ * "%.1e" sprintf ] unit-test +! This works even on windows (even though %.0e is special on +! windows) because it doesn't use the fast formatter from the +! system { "1e+418" } [ 987654321098765432 10 400 ^ * "%.0e" sprintf ] unit-test { "9e+417" } [ 937654321098765432 10 400 ^ * "%.0e" sprintf ] unit-test { "1.0e+418" } [ 997654321098765432 10 400 ^ * "%.1e" sprintf ] unit-test @@ -140,6 +143,7 @@ IN: formatting.tests { "[####monkey]" } [ "monkey" "[%'#10s]" sprintf ] unit-test { "[many monke]" } [ "many monkeys" "[%10.10s]" sprintf ] unit-test +{ "{ 1, 2, 3 }" } [ BV{ 1 2 3 } "%[%d, %]" sprintf ] unit-test { "{ 1, 2, 3 }" } [ { 1 2 3 } "%[%s, %]" sprintf ] unit-test { "{ 1:2, 3:4 }" } [ H{ { 1 2 } { 3 4 } } "%[%s: %s %]" sprintf ] unit-test @@ -167,5 +171,26 @@ ${ os windows? "3" "2" ? } [ 5/2 "%.0f" sprintf ] unit-test ! Differences on Windows due to setprecision(0) ${ os windows? "2.500000e+00" "2e+00" ? } [ 5/2 "%.0e" sprintf ] unit-test ${ os windows? "3.500000e+00" "4e+00" ? } [ 7/2 "%.0e" sprintf ] unit-test +${ os windows? "1.000000e+00" "1e+00" ? } [ 1.0 "%.0e" sprintf ] unit-test -{ "1e+00" } [ 1.0 "%.0e" sprintf ] unit-test +{ "00" } [ 2020 1 1 "%U" strftime ] unit-test +{ "00" } [ 2020 1 1 "%W" strftime ] unit-test + +{ "44" } [ 2020 11 6 "%U" strftime ] unit-test +{ "44" } [ 2020 11 6 "%W" strftime ] unit-test + +{ "00" } [ 2022 1 1 "%U" strftime ] unit-test +{ "01" } [ 2022 1 2 "%U" strftime ] unit-test +{ "01" } [ 2022 1 3 "%U" strftime ] unit-test + +{ "00" } [ 2022 1 1 "%W" strftime ] unit-test +{ "00" } [ 2022 1 2 "%W" strftime ] unit-test +{ "01" } [ 2022 1 3 "%W" strftime ] unit-test + +{ "34" } [ 2022 8 27 "%U" strftime ] unit-test +{ "35" } [ 2022 8 28 "%U" strftime ] unit-test +{ "35" } [ 2022 8 29 "%U" strftime ] unit-test + +{ "34" } [ 2022 8 27 "%W" strftime ] unit-test +{ "34" } [ 2022 8 28 "%W" strftime ] unit-test +{ "35" } [ 2022 8 29 "%W" strftime ] unit-test