From 01f63b9e940678f729df2ebad13ef5676daabcc8 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 20 May 2024 16:51:18 +0200 Subject: [PATCH] wip --- lib/logstorage/pipe_unpack_logfmt_test.go | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/logstorage/pipe_unpack_logfmt_test.go b/lib/logstorage/pipe_unpack_logfmt_test.go index d5a267adf..4cc73c5a6 100644 --- a/lib/logstorage/pipe_unpack_logfmt_test.go +++ b/lib/logstorage/pipe_unpack_logfmt_test.go @@ -4,6 +4,33 @@ import ( "testing" ) +func TestParsePipeUnpackLogfmtSuccess(t *testing.T) { + f := func(pipeStr string) { + t.Helper() + expectParsePipeSuccess(t, pipeStr) + } + + f(`unpack_logfmt`) + f(`unpack_logfmt from x`) + f(`unpack_logfmt from x result_prefix abc`) + f(`unpack_logfmt result_prefix abc`) +} + +func TestParsePipeUnpackLogfmtFailure(t *testing.T) { + f := func(pipeStr string) { + t.Helper() + expectParsePipeFailure(t, pipeStr) + } + + f(`unpack_logfmt foo`) + f(`unpack_logfmt from`) + f(`unpack_logfmt from x y`) + f(`unpack_logfmt from x result_prefix`) + f(`unpack_logfmt from x result_prefix a b`) + f(`unpack_logfmt result_prefix`) + f(`unpack_logfmt result_prefix a b`) +} + func TestPipeUnpackLogfmt(t *testing.T) { f := func(pipeStr string, rows, rowsExpected [][]Field) { t.Helper()