Skip to content

Commit c54575f

Browse files
author
tpfz
committed
fix ut
1 parent 91285f4 commit c54575f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/modules/evaluation/infra/repo/evaluator/mysql/evaluator_tag_filter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,10 @@ func TestGetSourceIDsByFilterConditions_SelfJoinAndLike(t *testing.T) {
543543
).WillReturnRows(countRows)
544544

545545
// 断言 SELECT:包含 DISTINCT、LEFT JOIN t_name、JOIN t_1 / t_2、LIKE 与 Name 标签限定
546-
// SearchKeyword 现在只搜索 tag_key=Name
546+
// SearchKeyword 现在只搜索 tag_key=Name(使用参数化查询,且可能被括号包裹)
547547
selectRows := sqlmock.NewRows([]string{"source_id"})
548548
mock.ExpectQuery(
549-
"SELECT DISTINCT .*source_id.* FROM `evaluator_tag`.*LEFT JOIN evaluator_tag AS t_name.*JOIN evaluator_tag AS t_1.*JOIN evaluator_tag AS t_2.*WHERE .*evaluator_tag.tag_key = .*Name.* AND evaluator_tag.tag_value LIKE .*",
549+
"SELECT DISTINCT .*source_id.* FROM `evaluator_tag`.*LEFT JOIN evaluator_tag AS t_name.*JOIN evaluator_tag AS t_1.*JOIN evaluator_tag AS t_2.*WHERE .*tag_key.*=.*AND.*tag_value.*LIKE.*ORDER BY.*",
550550
).WillReturnRows(selectRows)
551551

552552
dao := &EvaluatorTagDAOImpl{provider: mockProvider}

0 commit comments

Comments
 (0)