Pull request: dhcpd: normalize client host

Updates #2946.

Squashed commit of the following:

commit f830c03ddee65f7e86c43baa00a7dcc022091d93
Merge: df6c83d7 327e76cd
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 13 15:55:58 2021 +0300

    Merge branch 'master' into 2946-norm-dhcp-host

commit df6c83d7d117b718110a035216e708d5131bf71c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 13 15:49:03 2021 +0300

    dhcpd: imp docs

commit 1407e9bd7b7694bd3069349faba3ec9ff5eb468b
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 13 15:27:38 2021 +0300

    dhcpd: normalize client host
This commit is contained in:
Ainar Garipov
2021-04-13 16:00:09 +03:00
parent 327e76cd65
commit 773f02cf7d
4 changed files with 99 additions and 6 deletions

View File

@@ -46,9 +46,10 @@ func TestNullBool_UnmarshalText(t *testing.T) {
var got nullBool
err := got.UnmarshalJSON(tc.data)
if tc.wantErrMsg == "" {
assert.Nil(t, err)
assert.NoError(t, err)
} else {
require.NotNil(t, err)
require.Error(t, err)
assert.Equal(t, tc.wantErrMsg, err.Error())
}
@@ -63,7 +64,8 @@ func TestNullBool_UnmarshalText(t *testing.T) {
}
err := json.Unmarshal([]byte(`{"A":true}`), &got)
require.Nil(t, err)
require.NoError(t, err)
assert.Equal(t, want, got.A)
})
}