From 529fa7b26cd2dbb42b6f2f2a33f1cf7d4cdf6a05 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 20 Mar 2025 09:23:08 +0100 Subject: [PATCH] ts: fix _test_err_json comparison method Signed-off-by: Xavier Delaruelle --- testsuite/config/base-config.exp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/testsuite/config/base-config.exp b/testsuite/config/base-config.exp index 932a261a..04f04225 100644 --- a/testsuite/config/base-config.exp +++ b/testsuite/config/base-config.exp @@ -852,8 +852,14 @@ proc _test_err_json {test_shell cmd answer failcmd} { $answer_last_entry end-2 end]} { set errdiff 1 } - set comp_last_entry [string replace $comp_last_entry end-1 end ,] - set answer_last_entry [string replace $answer_last_entry end-1 end ,] + # make last content line with same structure as other lines (finishing by "\},") + if {[string index $comp_last_entry end] eq "\}"} { + append comp_last_entry , + append answer_last_entry , + } else { + set comp_last_entry [string replace $comp_last_entry end-1 end ,] + set answer_last_entry [string replace $answer_last_entry end-1 end ,] + } set comp_error_list [lreplace $comp_error_list end-2 end-2 $comp_last_entry] set answer_list [lreplace $answer_list end-2 end-2 $answer_last_entry]