@@ -80,6 +80,7 @@ void TestSearchFilterProxyModel::setupTestData()
8080 testItems.append (createTestAppItem (" org.deepin.music" , " 音乐" , " 音乐播放器" , " 音乐" , " deepin" , 12 ));
8181 testItems.append (createTestAppItem (" org.deepin.reader" , " 阅读器" , " 文档阅读器" , " 阅读" , " deepin" , 7 ));
8282 testItems.append (createTestAppItem (" org.deepin.calendar" , " 日历" , " 日历" , " 日历" , " deepin" , 4 ));
83+ testItems.append (createTestAppItem (" org.deepin.defender" , " 安全中心" , " 安全中心" , " 安全中心" , " deepin" , 4 ));
8384
8485 // 包含特殊符号的应用
8586 testItems.append (createTestAppItem (" org.special.app1" , " App@Name" , " App@Name" , " " , " special" , 1 ));
@@ -213,6 +214,11 @@ void TestSearchFilterProxyModel::testPinyinSearch()
213214 qCDebug (logTest) << " Pinyin initials search for 'rl' returned" << model.rowCount () << " items" ;
214215 QCOMPARE (model.rowCount (), 1 );
215216 QCOMPARE (model.data (model.index (0 , 0 ), AppItem::DesktopIdRole).toString (), " org.deepin.calendar" );
217+ qCDebug (logTest) << " Testing Pinyin initials match for 'aqzx'" ;
218+ model.setFilterRegularExpression (QRegularExpression (" aqzx" ));
219+ qCDebug (logTest) << " Pinyin initials search for 'aqzx' returned" << model.rowCount () << " items" ;
220+ QCOMPARE (model.rowCount (), 1 );
221+ QCOMPARE (model.data (model.index (0 , 0 ), AppItem::DesktopIdRole).toString (), " org.deepin.defender" );
216222 qCInfo (logTest) << " Pinyin search tests completed successfully" ;
217223}
218224
0 commit comments