diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-01-13 22:14:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-13 22:14:59 -0500 |
commit | 3c1a0ad19e7b044bb40f979ec4c5f81bf39dec4b (patch) | |
tree | b19ed1c0c1a15e084a8fd479b32fd0567aee19d3 /js/net_test.ts | |
parent | 9e9550ceeaa4d0751e8d1cb79acb962f1b8682d5 (diff) |
Properly parse network addresses. (#1515)
Diffstat (limited to 'js/net_test.ts')
-rw-r--r-- | js/net_test.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/js/net_test.ts b/js/net_test.ts index 4448b4cc1..6ba36547f 100644 --- a/js/net_test.ts +++ b/js/net_test.ts @@ -9,13 +9,12 @@ testPerm({ net: true }, function netListenClose() { }); testPerm({ net: true }, async function netDialListen() { - const addr = "127.0.0.1:4500"; - const listener = deno.listen("tcp", addr); + const listener = deno.listen("tcp", ":4500"); listener.accept().then(async conn => { await conn.write(new Uint8Array([1, 2, 3])); conn.close(); }); - const conn = await deno.dial("tcp", addr); + const conn = await deno.dial("tcp", "127.0.0.1:4500"); const buf = new Uint8Array(1024); const readResult = await conn.read(buf); assertEqual(3, readResult.nread); |