diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2024-04-07 16:04:23 +0100 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2024-04-07 16:04:23 +0100 |
commit | 7162ae8c641314846f0b565d7614ac8d71dbd628 (patch) | |
tree | fba1b545e6d20dac7f958bedf83afc61fcbbc256 /main/main_test.go | |
parent | 658900fcae610caace83a112ac0ee865108ebc92 (diff) | |
download | stred-go-7162ae8c641314846f0b565d7614ac8d71dbd628.tar |
Add merge command
Diffstat (limited to 'main/main_test.go')
-rw-r--r-- | main/main_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/main_test.go b/main/main_test.go index 7aa90aa..74f179b 100644 --- a/main/main_test.go +++ b/main/main_test.go @@ -64,6 +64,11 @@ func TestMain(t *testing.T) { input: miscInput, expected: `["Charlie Johnson","Tom Johnson","Charlie Chaplin","John Johnson"]`, }, + { + program: "s/#(\"people\" @(. #(\"first_name\" .)#)@)#/{ ms/#(\"people\" @(. (#(\"first_name\" \".{-0}$a\" \"last_name\" \".{-0}$b\")#$_) `#(\"name\" \"$a $b\")#`)@)#/ }", + input: miscInput, + expected: `{"something":{"nested":"Here is my test value"},"array":["Hello","world","these","are","values"],"people":[{"name":"Charlie Johnson","age":22},{"name":"Tom Johnson","age":18},{"name":"Charlie Chaplin","age":122},{"name":"John Johnson","age":48}]}`, + }, } for i, test := range tests { |