bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen { "name1", "hello %{dict:key0} %l and %{dict:key1}" },
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen { "name2", "%{dict:key2} also %{extra} plus" }
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen buffer_create_from_const_data(&keybuf, keys, sizeof(keys));
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen buffer_create_from_const_data(&fieldbuf, fields, sizeof(fields));
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen buffer_create_from_const_data(&objectbuf, objects, sizeof(objects));
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen array_create_from_buffer(&keyarr, &keybuf, sizeof(keys[0]));
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen array_create_from_buffer(&fieldarr, &fieldbuf, sizeof(fields[0]));
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen array_create_from_buffer(&objectarr, &objectbuf, sizeof(objects[0]));
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen test_assert(strcmp(db_dict_parse_cache_key(&keyarr, &fieldarr, &objectarr),
79042f8c2ec1778528584c064b164d1ebcdde16bTimo Sirainen "\t%d and %n\t%l\t%{foo}%r%{bar}\t%{test1}/path\t%{extra}\tpath2/%{test2}\t%{plop}") == 0);