addressed consistency
This commit is contained in:
1 parent
3b971cda61
commit
ebb471524e
8 files changed
+99
-81
No files matched your search
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
func TestPrettyPrinter_Render(t *testing.T) {
|
||||
func TestPrinter_Render(t *testing.T) {
|
||||
// Create test data
|
||||
aw := internal.NewAggregatorWriter()
|
||||
ctx := t.Context()
|
||||
@@ -58,7 +58,7 @@ func TestPrettyPrinter_Render(t *testing.T) {
|
||||
|
||||
// Create writing printer with buffer
|
||||
var buf bytes.Buffer
|
||||
pp := table.NewPrettyPrinter(&buf, localizer)
|
||||
pp := table.NewPrinter(&buf, localizer)
|
||||
|
||||
// Render the table
|
||||
pp.Render(aw)
|
||||
@@ -75,13 +75,13 @@ func TestPrettyPrinter_Render(t *testing.T) {
|
||||
│ 1 │ 840 - United States │ G01 │ 2023 │ 6 │ 20 │ 150.75 € │ 2023 │ 1 │ 15 │ 100.50 € │ 2.50 € │ 5.00 € │ 826 - United Kingdom │
|
||||
│ 2 │ 840 - United States │ G20 │ 2023 │ 9 │ 5 │ 225.50 € │ 2023 │ 3 │ 10 │ 200.00 € │ 3.00 € │ 7.50 € │ 826 - United Kingdom │
|
||||
├───┼─────────────────────┴──────┴──────┴───────┴─────┼──────────────┼──────┴───────┴─────┼──────────────┼─────────────────┼─────────────────┼──────────────────────┤
|
||||
│ │ SUM │ 376.25 € │ │ 300.5 € │ 5.5 € │ 12.5 € │ │
|
||||
│ │ SUM │ 376.25 € │ │ 300.50 € │ 5.50 € │ 12.50 € │ │
|
||||
└───┴─────────────────────────────────────────────────┴──────────────┴────────────────────┴──────────────┴─────────────────┴─────────────────┴──────────────────────┘
|
||||
`
|
||||
|
||||
// Compare output
|
||||
if got != want {
|
||||
t.Errorf("PrettyPrinter.Render() output doesn't match expected.\n\nGot:\n%s\n\nWant:\n%s", got, want)
|
||||
t.Errorf("Printer.Render() output doesn't match expected.\n\nGot:\n%s\n\nWant:\n%s", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ func TestRenderHTML(t *testing.T) {
|
||||
// Output buffer used only to satisfy the constructor contract; RenderHTML
|
||||
// must not write to it.
|
||||
var buf bytes.Buffer
|
||||
pp := table.NewPrettyPrinter(&buf, localizer)
|
||||
pp := table.NewPrinter(&buf, localizer)
|
||||
|
||||
html := pp.RenderHTML(aw)
|
||||
|
||||
|
||||
Reference in new issue
Block a user