Skip to content

Commit

Permalink
🧪 test: Fix /dist tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Feb 9, 2024
1 parent 83b9fa8 commit a30d6a6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,24 @@ const macro = (t, compare, a, rel, b) => {
t.true(rel(compare(a, b)));
};

const name = (compare) => {
switch (compare) {
case increasing: {
return 'increasing';
}

case decreasing: {
return 'decreasing';
}

default: {
throw new Error('unknown comparison function');
}
}
};

macro.title = (title, compare, a, rel, b) =>
title || `${compare.name}(${repr(a)}, ${repr(b)}) ${rel.name} 0`;
title || `${name(compare)}(${repr(a)}, ${repr(b)}) ${rel.name} 0`;

const fns = [
{compare: increasing, lt, gt},
Expand Down

0 comments on commit a30d6a6

Please sign in to comment.