From 093957b5156281d63d5e8efd5d799da104a5853b Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Fri, 21 Oct 2022 17:21:54 +0200 Subject: [PATCH] Add array default value to formatting test example 1 --- src/test_utils/example1.rs | 4 ++++ tests/format-output/1-default.json5 | 5 +++++ tests/format-output/1-default.toml | 5 +++++ tests/format-output/1-default.yaml | 5 +++++ tests/format-output/1-indent-2.toml | 5 +++++ tests/format-output/1-nested-gap-2.toml | 5 +++++ tests/format-output/1-no-comments.json5 | 1 + tests/format-output/1-no-comments.toml | 1 + tests/format-output/1-no-comments.yaml | 1 + 9 files changed, 32 insertions(+) diff --git a/src/test_utils/example1.rs b/src/test_utils/example1.rs index 72a936a..c1b8812 100644 --- a/src/test_utils/example1.rs +++ b/src/test_utils/example1.rs @@ -46,6 +46,10 @@ pub struct Headers { /// The header in which the reverse proxy specifies the display name. #[config(default = "x-display-name")] pub display_name: String, + + /// Headers that are allowed. + #[config(default = ["content-type", "content-encoding"])] + pub allowed: Vec, } diff --git a/tests/format-output/1-default.json5 b/tests/format-output/1-default.json5 index fbf8291..819f99d 100644 --- a/tests/format-output/1-default.json5 +++ b/tests/format-output/1-default.json5 @@ -30,6 +30,11 @@ // // Default value: "x-display-name" //display_name: "x-display-name", + + // Headers that are allowed. + // + // Default value: ["content-type","content-encoding"] + //allowed: ["content-type","content-encoding"], }, }, diff --git a/tests/format-output/1-default.toml b/tests/format-output/1-default.toml index e110c18..fdaf269 100644 --- a/tests/format-output/1-default.toml +++ b/tests/format-output/1-default.toml @@ -31,6 +31,11 @@ # Default value: "x-display-name" #display_name = "x-display-name" +# Headers that are allowed. +# +# Default value: ["content-type", "content-encoding"] +#allowed = ["content-type", "content-encoding"] + # Configuring the logging. [log] # If set to `true`, the app will log to stdout. diff --git a/tests/format-output/1-default.yaml b/tests/format-output/1-default.yaml index a5bd3e9..666cfa3 100644 --- a/tests/format-output/1-default.yaml +++ b/tests/format-output/1-default.yaml @@ -31,6 +31,11 @@ http: # Default value: x-display-name #display_name: x-display-name + # Headers that are allowed. + # + # Default value: [content-type, content-encoding] + #allowed: [content-type, content-encoding] + # Configuring the logging. log: # If set to `true`, the app will log to stdout. diff --git a/tests/format-output/1-indent-2.toml b/tests/format-output/1-indent-2.toml index 1b446cb..72739b6 100644 --- a/tests/format-output/1-indent-2.toml +++ b/tests/format-output/1-indent-2.toml @@ -31,6 +31,11 @@ # Default value: "x-display-name" #display_name = "x-display-name" + # Headers that are allowed. + # + # Default value: ["content-type", "content-encoding"] + #allowed = ["content-type", "content-encoding"] + # Configuring the logging. [log] # If set to `true`, the app will log to stdout. diff --git a/tests/format-output/1-nested-gap-2.toml b/tests/format-output/1-nested-gap-2.toml index 334b63e..3865dca 100644 --- a/tests/format-output/1-nested-gap-2.toml +++ b/tests/format-output/1-nested-gap-2.toml @@ -33,6 +33,11 @@ # Default value: "x-display-name" #display_name = "x-display-name" +# Headers that are allowed. +# +# Default value: ["content-type", "content-encoding"] +#allowed = ["content-type", "content-encoding"] + # Configuring the logging. [log] diff --git a/tests/format-output/1-no-comments.json5 b/tests/format-output/1-no-comments.json5 index 2c94b25..5ef0a5e 100644 --- a/tests/format-output/1-no-comments.json5 +++ b/tests/format-output/1-no-comments.json5 @@ -8,6 +8,7 @@ headers: { //username: "x-username", //display_name: "x-display-name", + //allowed: ["content-type","content-encoding"], }, }, diff --git a/tests/format-output/1-no-comments.toml b/tests/format-output/1-no-comments.toml index d8a0cea..7947964 100644 --- a/tests/format-output/1-no-comments.toml +++ b/tests/format-output/1-no-comments.toml @@ -7,6 +7,7 @@ [http.headers] #username = "x-username" #display_name = "x-display-name" +#allowed = ["content-type", "content-encoding"] [log] #stdout = true diff --git a/tests/format-output/1-no-comments.yaml b/tests/format-output/1-no-comments.yaml index eeb46a9..dab951e 100644 --- a/tests/format-output/1-no-comments.yaml +++ b/tests/format-output/1-no-comments.yaml @@ -7,6 +7,7 @@ http: headers: #username: x-username #display_name: x-display-name + #allowed: [content-type, content-encoding] log: #stdout: true