Skip to content

Commit

Permalink
test: update comment on stack difference
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabri3l committed Aug 1, 2023
1 parent 4cf9829 commit 27a5a5f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,11 @@ func TestMemArraysWithLenThreshold(t *testing.T) {
memUsageLimit,
SizeEmpty + // Array overhead
(50 * SizeNumber) + (50 * SizeBool) + // (450) size of property values
+1, // stack difference in removing an empty element (8) and adding true (1) + 50 (8)
// stack difference in going from
// [..other, []]
// to
// [..other, true, 50]
+1,
},
{
"array under threshold but over limit",
Expand Down Expand Up @@ -572,7 +576,11 @@ func TestMemArraysWithLenThreshold(t *testing.T) {
// Array overhead, size of property values
SizeEmpty + // Array overhead
(50 * SizeNumber) + (50 * SizeBool) + // (450) size of property values
+1, // stack difference in removing an empty element (8) and adding true (1) + 50 (8)
// stack difference in going from
// [..other, []]
// to
// [..other, true, 50]
+1,
},
{
"mixed scattered array over threshold wcs",
Expand All @@ -588,7 +596,11 @@ func TestMemArraysWithLenThreshold(t *testing.T) {
memUsageLimit,
SizeEmpty + // Array overhead,
(100 * SizeNumber) + // size of property values
+1, // stack difference in removing an empty element (8) and adding true (1) + 50 (8),
// stack difference in going from
// [..other, []]
// to
// [..other, true, 50]
+1,
},
} {
t.Run(fmt.Sprintf(tc.description), func(t *testing.T) {
Expand Down

0 comments on commit 27a5a5f

Please sign in to comment.