diff options
Diffstat (limited to 'cli/tests/complex_permissions_test.ts')
-rw-r--r-- | cli/tests/complex_permissions_test.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/tests/complex_permissions_test.ts b/cli/tests/complex_permissions_test.ts index ad8b5302c..f4b8e6c73 100644 --- a/cli/tests/complex_permissions_test.ts +++ b/cli/tests/complex_permissions_test.ts @@ -14,7 +14,11 @@ const test: { [key: string]: Function } = { }, netListen(endpoints: string[]): void { endpoints.forEach((endpoint) => { - const [hostname, port] = endpoint.split(":"); + const index = endpoint.lastIndexOf(":"); + const [hostname, port] = [ + endpoint.substr(0, index), + endpoint.substr(index + 1), + ]; const listener = Deno.listen({ transport: "tcp", hostname, @@ -25,7 +29,11 @@ const test: { [key: string]: Function } = { }, async netConnect(endpoints: string[]): Promise<void> { for (const endpoint of endpoints) { - const [hostname, port] = endpoint.split(":"); + const index = endpoint.lastIndexOf(":"); + const [hostname, port] = [ + endpoint.substr(0, index), + endpoint.substr(index + 1), + ]; const listener = await Deno.connect({ transport: "tcp", hostname, |