gagolews / gagolews/stringi

stri_sprintf is platform-dependent

Open
#444 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
318
Forks
48
PR merge metrics
No merged PRs in 30d

Description

macOS-latest (release) yields:

```
----- FAILED[data]: test-sprintf.R<25--25>
call| expect_identical(outer(f, x, stri_sprintf, na_string = "NA"),
call| --> outer(f, x, sprintf))
diff| 4 string mismatches
----- FAILED[data]: test-sprintf.R<203--203>
call| expect_identical(stri_sprintf("%08s", "abc"), sprintf("%08s",
call| --> "abc"))
diff| Expected '00000abc', got ' abc'
```

windows-latest (3.6):

```
----- FAILED[data]: test-sprintf.R<18--19>
call| expect_identical(stri_sprintf("%0000000000000000001$#0+ *0000002$.*003$e",
call| --> 1.23456, -12, 3), sprintf("%#0+-12.3e", 1.23456))
diff| Expected '+1.235e+00 ', got '+1.235e+000 '
----- FAILED[data]: test-sprintf.R<20--21>
call| expect_identical(stri_sprintf("%0000000000000000001$#0+ *0000002$.*003$e",
call| --> 1.23456, 12, 3), sprintf("%#0+12.3e", 1.23456))
diff| Expected '+001.235e+00', got '+01.235e+000'
----- FAILED[data]: test-sprintf.R<228--228>
call| expect_identical(stri_sprintf("%e", pi), sprintf("%e", pi))
diff| Expected '3.141593e+00', got '3.141593e+000'
----- FAILED[data]: test-sprintf.R<229--229>
call| expect_identical(stri_sprintf("%E", pi), sprintf("%E", pi))
diff| Expected '3.141593E+00', got '3.141593E+000'
----- FAILED[data]: test-sprintf.R<231--231>
call| expect_identical(stri_sprintf("%g", 1e+06 * pi), sprintf("%g",
call| --> 1e+06 * pi))
diff| Expected '3.14159e+06', got '3.14159e+006'
There were 50 or more warnings (use warnings() to see the first 50)
----- FAILED[data]: test-sprintf.R<233--233>
call| expect_identical(stri_sprintf("%G", 1e-06 * pi), sprintf("%G",
call| --> 1e-06 * pi))
diff| Expected '3.14159E-06', got '3.14159E-006'
----- FAILED[data]: test-sprintf.R<243--243>
call| expect_identical(stri_sprintf("%a", seq(0, 1, 0.1)), sprintf("%a",
call| --> seq(0, 1, 0.1)))
diff| 10 string mismatches
----- FAILED[data]: test-sprintf.R<244--244>
call| expect_identical(stri_sprintf("%a", c(0, 0.1, 0.2, 0.3, 0.4,
call| --> 0.5, 0.6, 0.7, 0.8, 0.9, 1)), sprintf("%a", c(0, 0.1, 0.2,
call| --> 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1)))
diff| 10 string mismatches
```

windows-latest (release):

```
----- FAILED[data]: test-sprintf.R<243--243>
call| expect_identical(stri_sprintf("%a", seq(0, 1, 0.1)), sprintf("%a",
call| --> seq(0, 1, 0.1)))
diff| 10 string mismatches
----- FAILED[data]: test-sprintf.R<244--244>
call| expect_identical(stri_sprintf("%a", c(0, 0.1, 0.2, 0.3, 0.4,
call| --> 0.5, 0.6, 0.7, 0.8, 0.9, 1)), sprintf("%a", c(0, 0.1, 0.2,
call| --> 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1)))
diff| 10 string mismatches
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The reported failures are in test-sprintf.R; start by running the sprintf comparisons on the macOS and Windows environments described in the issue. Compare stri_sprintf with sprintf for the listed formatting cases and identify the platform-dependent behavior. Done means the reported cases produce matching expected results across those platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, r
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.