diff options
author | Loïc Hoguin <[email protected]> | 2014-12-20 12:18:30 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-12-20 12:18:30 +0200 |
commit | bf3c8eb263811b41ffe8ff24a42466abc7633ac8 (patch) | |
tree | 318fd6898a3a4c7e7a3e68d73535b3be6de690e6 /src | |
parent | b2bf370f1e64764f7ddbe6216c7a521c3b4211cb (diff) | |
download | cowlib-bf3c8eb263811b41ffe8ff24a42466abc7633ac8.tar.gz cowlib-bf3c8eb263811b41ffe8ff24a42466abc7633ac8.tar.bz2 cowlib-bf3c8eb263811b41ffe8ff24a42466abc7633ac8.zip |
Simplify generators for language ranges
Diffstat (limited to 'src')
-rw-r--r-- | src/cow_http_hd.erl | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl index 5ff5274..8fe9f04 100644 --- a/src/cow_http_hd.erl +++ b/src/cow_http_hd.erl @@ -624,28 +624,10 @@ language_range_list_sep(<< $,, R/bits >>, Acc) -> language_range_list(R, Acc). -ifdef(TEST). language_range_tag() -> - oneof([ - [alpha()], - [alpha(), alpha()], - [alpha(), alpha(), alpha()], - [alpha(), alpha(), alpha(), alpha()], - [alpha(), alpha(), alpha(), alpha(), alpha()], - [alpha(), alpha(), alpha(), alpha(), alpha(), alpha()], - [alpha(), alpha(), alpha(), alpha(), alpha(), alpha(), alpha()], - [alpha(), alpha(), alpha(), alpha(), alpha(), alpha(), alpha(), alpha()] - ]). + vector(1, 8, alpha()). language_range_subtag() -> - [$-, oneof([ - [alphanum()], - [alphanum(), alphanum()], - [alphanum(), alphanum(), alphanum()], - [alphanum(), alphanum(), alphanum(), alphanum()], - [alphanum(), alphanum(), alphanum(), alphanum(), alphanum()], - [alphanum(), alphanum(), alphanum(), alphanum(), alphanum(), alphanum()], - [alphanum(), alphanum(), alphanum(), alphanum(), alphanum(), alphanum(), alphanum()], - [alphanum(), alphanum(), alphanum(), alphanum(), alphanum(), alphanum(), alphanum(), alphanum()] - ])]. + [$-, vector(1, 8, alphanum())]. language_range() -> [language_range_tag(), small_list(language_range_subtag())]. |