From a517a9985b1445b2f0f014368f475dd8a11f8401 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 14 Apr 2019 20:41:00 +0200 Subject: fixes another regression; the behaviour of 'array' formatting was changed --- lib/pure/strformat.nim | 8 -------- tests/stdlib/tstrformat.nim | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim index e12ca3c89..19fbf8ab3 100644 --- a/lib/pure/strformat.nim +++ b/lib/pure/strformat.nim @@ -513,14 +513,6 @@ template formatValue(result: var string; value: char; specifier: string) = template formatValue(result: var string; value: cstring; specifier: string) = result.add value -proc formatValue(result: var string; value: (array|seq|openArray); specifier: string) = - result.add "[" - for i, it in value: - if i != 0: - result.add ", " - result.formatValue(it, specifier) - result.add "]" - macro `&`*(pattern: string): untyped = ## For a specification of the ``&`` macro, see the module level documentation. if pattern.kind notin {nnkStrLit..nnkTripleStrLit}: diff --git a/tests/stdlib/tstrformat.nim b/tests/stdlib/tstrformat.nim index 86125ca00..ec74323d3 100644 --- a/tests/stdlib/tstrformat.nim +++ b/tests/stdlib/tstrformat.nim @@ -65,6 +65,14 @@ doAssert fmt"{0.0: g}" == " 0" let data1 = [1'i64, 10000'i64, 10000000'i64] let data2 = [10000000'i64, 100'i64, 1'i64] +proc formatValue(result: var string; value: (array|seq|openArray); specifier: string) = + result.add "[" + for i, it in value: + if i != 0: + result.add ", " + result.formatValue(it, specifier) + result.add "]" + doAssert fmt"data1: {data1:8} #" == "data1: [ 1, 10000, 10000000] #" doAssert fmt"data2: {data2:8} =" == "data2: [10000000, 100, 1] =" -- cgit 1.4.1-2-gfad0 202ac'>commit diff stats
path: root/linux/mu-init-test.subx
blob: 1b2d16832b1c896501affafb9ec1c24bead67407 (plain) (tree)
1
2
3
4
5
6
7