Skip to content

Commit

Permalink
Debug flexint_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
arturogonzalezm committed Jul 29, 2024
1 parent bc5c59f commit f07d4c3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/flexint/flexint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ func TestInt64_UnmarshalJSON_LargeFloat(t *testing.T) {
err := json.Unmarshal([]byte(tt.input), &fi)
require.NoError(t, err)
assert.Equal(t, tt.expected, fi, "For input: %s", tt.input)

// Debugging information
if tt.expected != fi {
t.Logf("Input: %s, Expected: %d, Got: %d", tt.input, tt.expected, fi)
}
})
}
}
Expand All @@ -90,6 +95,11 @@ func TestInt64_UnmarshalJSON_FloatPrecision(t *testing.T) {
err := json.Unmarshal([]byte(tt.input), &fi)
require.NoError(t, err)
assert.Equal(t, tt.expected, fi, "For input: %s", tt.input)

// Debugging information
if tt.expected != fi {
t.Logf("Input: %s, Expected: %d, Got: %d", tt.input, tt.expected, fi)
}
})
}
}
Expand All @@ -111,6 +121,11 @@ func TestInt64_UnmarshalJSON_FloatRounding(t *testing.T) {
err := json.Unmarshal([]byte(tt.input), &fi)
require.NoError(t, err)
assert.Equal(t, tt.expected, fi, "For input: %s", tt.input)

// Debugging information
if tt.expected != fi {
t.Logf("Input: %s, Expected: %d, Got: %d", tt.input, tt.expected, fi)
}
})
}
}
Expand All @@ -133,6 +148,11 @@ func TestInt64_UnmarshalJSON_ScientificNotation(t *testing.T) {
err := json.Unmarshal([]byte(tt.input), &fi)
require.NoError(t, err)
assert.Equal(t, tt.expected, fi)

// Debugging information
if tt.expected != fi {
t.Logf("Input: %s, Expected: %d, Got: %d", tt.input, tt.expected, fi)
}
})
}
}

0 comments on commit f07d4c3

Please sign in to comment.