Branch: Tag:

2022-07-15

2022-07-15 09:09:26 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Testsuite [sprintf]: Fix some broken tests of %[n].

The old typechecker had an off by one error with respect to the
actual implementation.

863:   dnl The following is due to (string & sprintf_result) == sprintf_result.   test_equal([[ typeof(sprintf("%c\n", Stdio)); ]],    [[ sprintf_result; ]]); - test_equal([[ typeof(sprintf("%4[1]c", 17)); ]], + test_equal([[ typeof(sprintf("%4[0]c", 17)); ]],    [[ typeof([string(8bit)](mixed)"") ]]); - test_equal([[ typeof(sprintf("%[1]n", 17)); ]], + test_equal([[ typeof(sprintf("%[0]n", 17)); ]],    [[ typeof("") ]]); -  + test_equal([[ typeof(sprintf("%4[1]c", 0, 17)); ]], +  [[ typeof([string(8bit)](mixed)"") ]]); + test_equal([[ typeof(sprintf("%[1]n", 0, 17)); ]], +  [[ typeof("") ]]);      test_equal([[ typeof(aggregate("foo"));]],    [[ typeof([array(string(3: 102..111))](mixed)({})) ]]);