It matches both at the beginning and at the end here.
It doesn't read like it does. Also not according to my testing using [this](https://gitlab.winehq.org/wine/wine/-/snippets/12):
<details> <summary>This MR</summary>
``` query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "USB"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "USB%"
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_00\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_00\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_02\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_02\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "6&2"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "%6&2"
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_00\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_02\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "MI_01%"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "%MI_01"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "%MI_01%"
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "USB%MI_01%"
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; }; ``` </details>
<details> <summary>Current Master</summary>
``` query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "USB"
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_00\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_00\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_02\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_02\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "USB%"
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_00\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_00\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_01\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_02\512&1347&4&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
instance of Win32_PnPEntity { DeviceId = "USB\VID_1050&PID_0407&MI_02\512&1347&6&2"; Manufacturer = "The Wine Project"; Name = "Wine PnP Device"; };
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "6&2"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "%6&2"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "MI_01%"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "%MI_01"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "%MI_01%"
query: SELECT DeviceID FROM Win32_PnPEntity WHERE DeviceID LIKE "USB%MI_01%" ``` </details>
This could use some tests.
Definitely! I've been testing it via the program I've linked when I was writing this implementation. Do you have any idea how to made them work reliably? We cannot guarantee any devices on different system to be present. Especially between Windows and Linux. I've looked at some of the existing tests and they are just executing, never checking the result.
I've also haven't seen anything being unit tested in Wine. It might be fitting approach here.