Unverified Commit cf0fcd45 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] detect ipv6 in fuchsia server url (#55605)

parent 35edbe3d
......@@ -192,7 +192,7 @@ class FuchsiaPackageServer {
Process _process;
/// The URL that can be used by the device to access this package server.
String get url => 'http://$_host:$_port';
String get url => Uri(scheme: 'http', host: _host, port: _port).toString();
// The name used to reference the server by fuchsia-pkg:// urls.
final String name;
......
......@@ -71,6 +71,16 @@ void main() {
FuchsiaArtifacts: () => mockFuchsiaArtifacts,
ProcessManager: () => mockProcessManager,
});
testWithoutContext('ipv6 formatting logic of FuchsiaPackageServer', () {
const String host = 'fe80::ec4:7aff:fecc:ea8f%eno2';
const int port = 23;
expect(
FuchsiaPackageServer('a', 'b', host, port).url,
'http://[fe80::ec4:7aff:fecc:ea8f%25eno2]:23',
);
});
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment