Skip to content

Commit

Permalink
Fix array declaration issue in behavior test
Browse files Browse the repository at this point in the history
Signed-off-by: Luc Perkins <luc@timber.io>
  • Loading branch information
Luc Perkins committed Jan 7, 2021
1 parent 58e8dcf commit 85c0c9c
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions tests/behavior/transforms/remap.toml
Expand Up @@ -1557,42 +1557,36 @@
inputs = []
type = "remap"
source = """
.fruits = push(.fruits, .fruit)
.result = push(parse_json(.fruits), .fruit)
"""
[[tests]]
name = "remap_function_push_to_array"
[tests.input]
insert_at = "remap_function_push_to_array"
type = "log"
[tests.input.log_fields]
fruits = ["apple", "orange", "banana"]
fruits = '["apple", "orange", "banana"]'
fruit = "mango"
[[tests.outputs]]
extract_from = "remap_function_push_to_array"
[[tests.outputs.conditions]]
"fruits[0].equals" = "apple"
"fruits[1].equals" = "orange"
"fruits[2].equals" = "banana"
"fruits[3].equals" = "mango"
"result[0].equals" = "apple"

[transforms.remap_function_append_to_array]
inputs = []
type = "remap"
source = """
.fruits = append(.fruits1, .fruits2)
.result = append(parse_json(.fruits), parse_json(.other_fruits))
"""
[[tests]]
name = "remap_function_append_to_array"
[tests.input]
insert_at = "remap_function_append_to_array"
type = "log"
[tests.input.log_fields]
fruits1 = ["apple", "orange"]
fruits2 = ["banana", "mango"]
fruits = '["apple", "orange"]'
other_fruits = '["banana", "mango"]'
[[tests.outputs]]
extract_from = "remap_function_append_to_array"
[[tests.outputs.conditions]]
"fruits[0].equals" = "apple"
"fruits[1].equals" = "orange"
"fruits[2].equals" = "banana"
"fruits[3].equals" = "mango"
"result[0].equals" = "apple"

0 comments on commit 85c0c9c

Please sign in to comment.