-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zetxx
committed
Aug 18, 2022
1 parent
591aafa
commit 2b4472c
Showing
9 changed files
with
226 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,3 @@ tap.test('Vector: Existing Methods a.in and a.out', async(l0) => { | |
l0.end(); | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
const tap = require('tap'); | ||
const { | ||
vectorPassFactory, | ||
timeOut, | ||
vectorFactory, | ||
methodRegisterFactory | ||
} = require('../helpers'); | ||
|
||
const v1 = vectorFactory({config: {id: 'V'}}); | ||
methodRegisterFactory(v1, 'a.in'); | ||
methodRegisterFactory(v1, 'a.out'); | ||
methodRegisterFactory(v1, '*.in', () => undefined); | ||
methodRegisterFactory(v1, '*.out', () => undefined); | ||
|
||
tap.test('Vector: Existing Methods a.in and a.out, * methods also exists but returns no result', async(l0) => { | ||
try { | ||
const r1 = await vectorPassFactory( | ||
v1, | ||
['Existing Methods a.in and a.out, dir in > out'], | ||
false, | ||
['a','in'] | ||
); | ||
setTimeout(async() => { | ||
await vectorPassFactory( | ||
v1, | ||
r1.payload, | ||
false, | ||
['a', 'out'], | ||
{idx: r1.request.idx, tag: r1.request.tag} | ||
); | ||
}, 500); | ||
const {packet} = await r1.request.promise; | ||
l0.same(packet, { | ||
payload: [ | ||
'Existing Methods a.in and a.out, dir in > out', | ||
'>a.in', | ||
'X:a.in', | ||
'>a.out', | ||
'X:a.out' | ||
], | ||
meta: {method: 'a', direction: 'out'}, | ||
match: {idx: 1, tag: Symbol('V')} | ||
}, 'packet struct should match, direction in > out'); | ||
|
||
const r2 = await vectorPassFactory( | ||
v1, | ||
['Existing Methods a.in and a.out, dir out > in'], | ||
false, | ||
['a', 'out'] | ||
); | ||
setTimeout(async() => { | ||
await vectorPassFactory( | ||
v1, | ||
r2.payload, | ||
false, | ||
['a', 'in'], | ||
{idx: r2.request.idx, tag: r2.request.tag} | ||
); | ||
}, 500); | ||
const {packet: p2} = await r2.request.promise; | ||
l0.same(p2, { | ||
payload: [ | ||
'Existing Methods a.in and a.out, dir out > in', | ||
'>a.out', | ||
'X:a.out', | ||
'>a.in', | ||
'X:a.in' | ||
], | ||
meta: {method: 'a', direction: 'in'}, | ||
match: {idx: 2, tag: Symbol('V')} | ||
}, 'packet struct should match, direction out > in'); | ||
} catch (e) { | ||
console.error(e); | ||
} finally { | ||
v1.destroy(); | ||
l0.end(); | ||
} | ||
}); |
Oops, something went wrong.