From 5a1fdc8cd698e36979cfbe62c4d95893363864ee Mon Sep 17 00:00:00 2001 From: William Elwood Date: Tue, 9 Jun 2020 15:51:23 +0100 Subject: [PATCH] Fix unit tests on Win10 Untested attempt to fix unit tests that fail on Windows 10 build 1909. From the test output mentioned in #1332, it looks like this version of Windows doesn't report an "invalid port" error when asked to connect to an invalid port, instead it treats the port as part of the host name and attempts a DNS lookup. Naturally, this fails because the colon character is not valid in a host name. This change simply makes this inexplicable error an expected result since the outcome is the same and we can't fix Windows. --- dnscrypt-proxy/sources_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnscrypt-proxy/sources_test.go b/dnscrypt-proxy/sources_test.go index e060ddcc..0c9847ad 100644 --- a/dnscrypt-proxy/sources_test.go +++ b/dnscrypt-proxy/sources_test.go @@ -309,7 +309,7 @@ func prepSourceTestDownload(t *testing.T, d *SourceTestData, e *SourceTestExpect e.err = "unexpected EOF" case TestStateOpenErr, TestStateOpenSigErr: path = "00000" + path // high numeric port is parsed but then fails to connect - e.err = "invalid port" + e.err = "invalid port|no such host" case TestStatePathErr: path = "..." + path // non-numeric port fails URL parsing }