Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ambiguity in trafficserver_records, add test #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/test_trafficserver.aug
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,27 @@ module Test_trafficserver =
{"@action" = "allow"}
}

let _ = print_regexp (lens_ctype Trafficserver_records.records_lns)
let _ = print_endline ""

test Trafficserver_records.records_lns get "CONFIG proxy.config.net.sock_send_buffer_size_in INT 262144
CONFIG proxy.config.net.sock_recv_buffer_size_in INT 0
CONFIG proxy.config.net.sock_send_buffer_size_out INT 0
CONFIG proxy.config.net.sock_recv_buffer_size_out INT 0\n" =
{ "proxy.config.net.sock_send_buffer_size_in" = "262144"
{ "type" = "CONFIG" }
{ "value_type" = "INT" }
}
{ "proxy.config.net.sock_recv_buffer_size_in" = "0"
{ "type" = "CONFIG" }
{ "value_type" = "INT" }
}
{ "proxy.config.net.sock_send_buffer_size_out" = "0"
{ "type" = "CONFIG" }
{ "value_type" = "INT" }
}
{ "proxy.config.net.sock_recv_buffer_size_out" = "0"
{ "type" = "CONFIG" }
{ "value_type" = "INT" }
}

2 changes: 1 addition & 1 deletion trafficserver_records.aug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Trafficserver_records =
let spc = Util.del_ws_spc
let type_re = "CONFIG" | "PROCESS" | "NODE" | "CLUSTER" | "LOCAL" | "PLUGIN"
let key_re = /[A-Za-z0-9_.-]+/
let value_re = /[^ \t\n#]([^#]*[^ \t\n#])?/
let value_re = /[^ \t\n#]([^\n#]*[^ \t\n#])?/
let value_type_re = "INT" | "FLOAT" | "STRING" | "COUNTER"

let records_entry = [ [ label "type" . store type_re] . spc . key key_re . spc . [ label "value_type" . store value_type_re ] . spc . store value_re . eol ]
Expand Down