|
1 |
| -import test from 'ava' ; |
2 |
| -import { list , map , sorted } from '@aureooms/js-itertools' ; |
3 |
| -import { increasing , fixedlexicographical } from '@aureooms/js-compare' ; |
4 |
| -import mincut from "../../src/index.js" ; |
| 1 | +import test from 'ava'; |
| 2 | +import {map, sorted} from '@aureooms/js-itertools'; |
| 3 | +import {increasing, fixedlexicographical} from '@aureooms/js-compare'; |
| 4 | +import mincut from '../../src/index.js'; |
5 | 5 |
|
6 |
| -function order ( edge ) { |
7 |
| - return sorted( increasing , edge ) ; |
| 6 | +function order(edge) { |
| 7 | + return sorted(increasing, edge); |
8 | 8 | }
|
9 | 9 |
|
10 |
| -function sort ( edges ) { |
11 |
| - return sorted( fixedlexicographical( increasing , 2 ) , map( order , edges ) ) ; |
| 10 | +function sort(edges) { |
| 11 | + return sorted(fixedlexicographical(increasing, 2), map(order, edges)); |
12 | 12 | }
|
13 | 13 |
|
14 |
| -function macro ( t , edges , expected ) { |
| 14 | +function macro(t, edges, expected) { |
15 | 15 | const cut = mincut(edges);
|
16 | 16 | t.deepEqual(sort(cut), sort(expected));
|
17 | 17 | }
|
18 | 18 |
|
19 |
| -macro.title = title => title ; |
| 19 | +macro.title = (title) => title; |
20 | 20 |
|
21 | 21 | // 0--1
|
22 |
| -test( 'single' , macro , [[0,1]] , [[0,1]] ) ; |
| 22 | +test('single', macro, [[0, 1]], [[0, 1]]); |
23 | 23 |
|
24 | 24 | // 5 2
|
25 | 25 | // |\ /|
|
26 | 26 | // | 0--1 |
|
27 | 27 | // |/ \|
|
28 | 28 | // 4 3
|
29 |
| -test( 'butterfly' , macro , [[0,1],[1,2],[1,3],[2,3],[0,4],[0,5],[4,5]] , [[0,1]] ) ; |
| 29 | +test( |
| 30 | + 'butterfly', |
| 31 | + macro, |
| 32 | + [ |
| 33 | + [0, 1], |
| 34 | + [1, 2], |
| 35 | + [1, 3], |
| 36 | + [2, 3], |
| 37 | + [0, 4], |
| 38 | + [0, 5], |
| 39 | + [4, 5], |
| 40 | + ], |
| 41 | + [[0, 1]], |
| 42 | +); |
0 commit comments