Read misc.loglevel from RFC 5424 and POSIX <syslog.h> #28
@@ -119,6 +119,8 @@ func TestShippedMiscReferenceData(t *testing.T) {
|
|||||||
"protocol": regexp.MustCompile(`^\S+( \S+)*$`),
|
"protocol": regexp.MustCompile(`^\S+( \S+)*$`),
|
||||||
"protocol.name": regexp.MustCompile(`\S`),
|
"protocol.name": regexp.MustCompile(`\S`),
|
||||||
"protocol.number": regexp.MustCompile(`^\d{1,3}$`),
|
"protocol.number": regexp.MustCompile(`^\d{1,3}$`),
|
||||||
|
"loglevel": regexp.MustCompile(`^(Alert|Critical|Debug|Emergency|Error|Informational|Notice|Warning)$`),
|
||||||
|
"loglevel.code": regexp.MustCompile(`^[0-7]$`),
|
||||||
"tld": regexp.MustCompile(`^\.[a-z0-9]([a-z0-9-]*[a-z0-9])?$`),
|
"tld": regexp.MustCompile(`^\.[a-z0-9]([a-z0-9-]*[a-z0-9])?$`),
|
||||||
"tld.type": regexp.MustCompile(`^(country-code|generic|generic-restricted|infrastructure|sponsored)$`),
|
"tld.type": regexp.MustCompile(`^(country-code|generic|generic-restricted|infrastructure|sponsored)$`),
|
||||||
"tld.unicode": regexp.MustCompile(`^\.\S+$`),
|
"tld.unicode": regexp.MustCompile(`^\.\S+$`),
|
||||||
|
|||||||
@@ -725,6 +725,15 @@ func TestShippedTables(t *testing.T) {
|
|||||||
"tld[.рф]": ".xn--p1ai",
|
"tld[.рф]": ".xn--p1ai",
|
||||||
"tld[.xn--p1ai].unicode": ".рф",
|
"tld[.xn--p1ai].unicode": ".рф",
|
||||||
"territory[NP].timezone.offset": "+05:45",
|
"territory[NP].timezone.offset": "+05:45",
|
||||||
|
"loglevel[0]": "Emergency",
|
||||||
|
"loglevel[1]": "Alert",
|
||||||
|
"loglevel[2]": "Critical",
|
||||||
|
"loglevel[3]": "Error",
|
||||||
|
"loglevel[4]": "Warning",
|
||||||
|
"loglevel[5]": "Notice",
|
||||||
|
"loglevel[6]": "Informational",
|
||||||
|
"loglevel[7]": "Debug",
|
||||||
|
"loglevel[Informational].code": "6",
|
||||||
} {
|
} {
|
||||||
if got := fake(t, f, path); got != want {
|
if got := fake(t, f, path); got != want {
|
||||||
t.Errorf("Fake(%q) = %q, want %q", path, got, want)
|
t.Errorf("Fake(%q) = %q, want %q", path, got, want)
|
||||||
|
|||||||
Reference in New Issue
Block a user