Skip to content

Commit

Permalink
fix(report): update regex pattern to include more separator lines
Browse files Browse the repository at this point in the history
  • Loading branch information
penandlim committed Jan 17, 2025
1 parent df5059d commit 4446bc3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ exports.computeDiffs = exports.loadReports = exports.variation = void 0;
const orderBy_1 = __importDefault(__nccwpck_require__(94791));
const minimatch_1 = __nccwpck_require__(4501);
const reportHeaderRegex = /^\| .+:.+ contract +\|/gi;
const reportSeparatorRegex = /^[\|╭╰]---/;
const reportSeparatorRegex = /^(?:[\|╭╰+][-=]+|\|[\s|]+$)/;
const variation = (current, previous) => {
const delta = current - previous;
return {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Minimatch } from "minimatch";
import { DiffReport, GasReport, SortCriterion, SortOrder } from "./types";

const reportHeaderRegex = /^\| .+:.+ contract +\|/gi;
const reportSeparatorRegex = /^[\|]---/;
const reportSeparatorRegex = /^(?:[\|+][-=]+|\|[\s|]+$)/;

export const variation = (current: number, previous: number) => {
const delta = current - previous;
Expand Down
4 changes: 3 additions & 1 deletion tests/mocks/gas_report.2.ansi
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,13 @@ Running 17 tests for test-foundry/compound/TestWithdraw.t.sol:TestWithdraw
Test result: ok. 17 passed; 0 failed; finished in 118.90s
╭-----------------------------------------------------------------+-----------------+-------+--------+-------+---------╮
| contracts/compound/IncentivesVault.sol:IncentivesVault Contract | | | | | |
|-----------------------------------------------------------------|-----------------|-------|--------|-------|---------|
+======================================================================================================================+
| Deployment Cost | Deployment Size | | | | |
|-----------------------------------------------------------------+-----------------+-------+--------+-------+---------|
| 640594 | 3430 | | | | |
|-----------------------------------------------------------------+-----------------+-------+--------+-------+---------|
| | | | | | |
|-----------------------------------------------------------------+-----------------+-------+--------+-------+---------|
| Function Name | min | avg | median | max | # calls |
|-----------------------------------------------------------------+-----------------+-------+--------+-------+---------|
| MAX_BASIS_POINTS | 305 | 305 | 305 | 305 | 1 |
Expand Down

0 comments on commit 4446bc3

Please sign in to comment.