From 0e612effbe72c3a583146f3eede8f4e03885637d Mon Sep 17 00:00:00 2001 From: Alynx Zhou Date: Tue, 20 Dec 2022 09:58:31 +0800 Subject: [PATCH] tests: Update search tests for desktop-icon-info Because we now put substring match in the next group of prefix match, the test cases should also be updated. --- gio/tests/desktop-app-info.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c index 33eb3985b..a153e6c0f 100644 --- a/gio/tests/desktop-app-info.c +++ b/gio/tests/desktop-app-info.c @@ -867,11 +867,12 @@ test_search (void) assert_search ("image viewer", "", TRUE, TRUE, NULL, NULL); /* There're "flatpak" apps (clocks) installed as well - they should *not* - * match the prefix command ("/bin/sh") in the Exec= line though. However, - * with substring matching, Image Viewer (eog) should be in result list - * because it contains "Slideshow" in its keywords. + * match the prefix command ("/bin/sh") in the Exec= line though. Then with + * substring matching, Image Viewer (eog) should be in next group because it + * contains "Slideshow" in its keywords. */ - assert_search ("sh", "eog.desktop gnome-terminal.desktop\n", TRUE, FALSE, NULL, NULL); + assert_search ("sh", "gnome-terminal.desktop\n" + "eog.desktop\n", TRUE, FALSE, NULL, NULL); /* "frobnicator.desktop" is ignored by get_all() because the binary is * missing, but search should still find it (to avoid either stale results @@ -886,11 +887,12 @@ test_search (void) assert_search ("files file fil fi f", "nautilus.desktop\n" "gedit.desktop\n", TRUE, TRUE, NULL, NULL); - /* With substring match, "con" match dconf, contacts, nautilus-classic (which - * has a name called "Desktop Icons"), nautilus-connect-server (which has a - * name called "Connect to Server"). + /* "con" will match "connect" and "contacts" on name with prefix match in + * first group, then match "Dconf Editor" and "Desktop Icons" with substring + * match in next group. */ - assert_search ("con", "dconf-editor.desktop gnome-contacts.desktop nautilus-classic.desktop nautilus-connect-server.desktop\n", TRUE, TRUE, NULL, NULL); + assert_search ("con", "gnome-contacts.desktop nautilus-connect-server.desktop\n" + "dconf-editor.desktop nautilus-classic.desktop\n", TRUE, TRUE, NULL, NULL); /* "gnome" will match "eye of gnome" from the user's directory, plus * matching "GNOME Clocks" X-GNOME-FullName. It's only a comment on