From 356978f358a29e7d848534704cbbd3261434e9f4 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Tue, 24 May 2022 17:01:24 +0300 Subject: [PATCH] Common: add tests for printf --- tests/printf_orig.yml | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/printf_orig.yml b/tests/printf_orig.yml index dde6456..84f2371 100644 --- a/tests/printf_orig.yml +++ b/tests/printf_orig.yml @@ -610,3 +610,58 @@ - result: '-05' args: [['%03.0g', -5.0]] float: true + +# length + +- result: '' + args: [['%.0s', 'Hello testing']] +- result: ' ' + args: [['%20.0s', 'Hello testing']] +- result: '' + args: [['%.s', 'Hello testing']] +- result: ' ' + args: [['%20.s', 'Hello testing']] +- result: ' 1024' + args: [['%20.0d', 1024]] +- result: ' -1024' + args: [['%20.0d', -1024]] +- result: ' ' + args: [['%20.d', 0]] +- result: ' 1024' + args: [['%20.0i', 1024]] +- result: ' -1024' + args: [['%20.i', -1024]] +- result: ' ' + args: [['%20.i', 0]] +- result: ' 1024' + args: [['%20.u', 1024]] +- result: ' 4294966272' + args: [['%20.0u', 4_294_966_272]] +- result: ' ' + args: [['%20.u', 0]] +- result: ' 777' + args: [['%20.o', 511]] +- result: ' 37777777001' + args: [['%20.0o', 4_294_966_785]] +- result: ' ' + args: [['%20.o', 0]] +- result: ' 1234abcd' + args: [['%20.x', 305_441_741]] +- result: ' 1234abcd' + args: [['%50.x', 305_441_741]] +- result: ' 1234abcd 12345' + args: [['%50.x', 305_441_741], ['%10.u', 12345]] +- result: ' edcb5433' + args: [['%20.0x', 3_989_525_555]] +- result: ' ' + args: [['%20.x', 0]] +- result: ' 1234ABCD' + args: [['%20.X', 305_441_741]] +- result: ' EDCB5433' + args: [['%20.0X', 3_989_525_555]] +- result: ' ' + args: [['%20.X', 0]] +- result: ' ' + args: [['%02.0u', 0]] +- result: ' ' + args: [['%02.0d', 0]]