From 0127628a1eef05abd11f7266671cdd148d883225 Mon Sep 17 00:00:00 2001 From: sunlei Date: Tue, 16 Jun 2026 07:54:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=B6=E6=95=9BBangDream=E8=87=AA?= =?UTF-8?q?=E7=94=B1=E8=AF=8D=E6=90=9C=E7=B4=A2=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/bangdream/src/domain/search/fuzzy-search.ts | 2 +- test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/qqbot/plugins/bangdream/src/domain/search/fuzzy-search.ts b/src/modules/qqbot/plugins/bangdream/src/domain/search/fuzzy-search.ts index 9f0005a..71a38ca 100644 --- a/src/modules/qqbot/plugins/bangdream/src/domain/search/fuzzy-search.ts +++ b/src/modules/qqbot/plugins/bangdream/src/domain/search/fuzzy-search.ts @@ -278,7 +278,7 @@ export function match( } if (matchesOnlyAll(matches, keyCount)) { - return matches._all.some((keyword) => + return matches._all.every((keyword) => targetIncludesAllKeyword(target, keyword), ); } diff --git a/test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts b/test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts index df2b627..4b67f9b 100644 --- a/test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts +++ b/test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts @@ -38,6 +38,12 @@ describe('BangDream fuzzy search helpers', () => { expect(match({ _all: ['summer'] }, { title: ['Summer Dive'] }, [])).toBe( true, ); + expect( + match({ _all: ['fire', 'bird'] }, { title: ['FIRE BIRD'] }, []), + ).toBe(true); + expect( + match({ _all: ['fire', 'bird'] }, { title: ['Light a fire'] }, []), + ).toBe(false); expect( match( { scoreUpMaxValue: [100], _number: [100] },