@@ -6,15 +6,15 @@ local sleep = system.sleep
66
77local function find_by_id (devs )
88 for _ , dev in ipairs (devs ) do
9- if dev .by_id and next (dev .by_id ) then
9+ if dev .id_aliases and next (dev .id_aliases ) then
1010 return dev
1111 end
1212 end
1313end
1414
1515local function find_by_path (devs )
1616 for _ , dev in ipairs (devs ) do
17- if dev .by_path and next (dev .by_path ) then
17+ if dev .path_aliases and next (dev .path_aliases ) then
1818 return dev
1919 end
2020 end
@@ -79,16 +79,16 @@ describe("evdev.devices", function()
7979
8080 it (" attaches alias lists when present" , function ()
8181 for _ , info in ipairs (devs ) do
82- if info .by_id then
83- assert .Table (info .by_id )
84- for _ , alias in ipairs (info .by_id ) do
82+ if info .id_aliases then
83+ assert .Table (info .id_aliases )
84+ for _ , alias in ipairs (info .id_aliases ) do
8585 assert .String (alias )
8686 end
8787 end
8888
89- if info .by_path then
90- assert .Table (info .by_path )
91- for _ , alias in ipairs (info .by_path ) do
89+ if info .path_aliases then
90+ assert .Table (info .path_aliases )
91+ for _ , alias in ipairs (info .path_aliases ) do
9292 assert .String (alias )
9393 end
9494 end
@@ -127,7 +127,7 @@ describe("evdev.devices", function()
127127 pending (" no discovered device with a by-id alias" )
128128 end
129129
130- local dev = find (dev_with_alias .by_id [1 ])
130+ local dev = find (dev_with_alias .id_aliases [1 ])
131131 assert .Table (dev ) --- @cast dev -?
132132 assert .Equal (dev_with_alias .path , dev .path )
133133 end )
@@ -138,7 +138,7 @@ describe("evdev.devices", function()
138138 pending (" no discovered device with a by-path alias" )
139139 end
140140
141- local dev = find (dev_with_alias .by_path [1 ])
141+ local dev = find (dev_with_alias .path_aliases [1 ])
142142 assert .Table (dev ) --- @cast dev -?
143143 assert .Equal (dev_with_alias .path , dev .path )
144144 end )
@@ -180,7 +180,7 @@ describe("evdev.devices", function()
180180 pending (" no discovered device with a by-id alias" )
181181 end
182182
183- local dev = find_all (dev_with_alias .by_id [1 ])
183+ local dev = find_all (dev_with_alias .id_aliases [1 ])
184184 assert .Table (dev ) --- @cast dev -?
185185 assert .Equal (1 , # dev )
186186 assert .Equal (dev_with_alias .path , dev [1 ].path )
@@ -192,7 +192,7 @@ describe("evdev.devices", function()
192192 pending (" no discovered device with a by-path alias" )
193193 end
194194
195- local dev = find_all (dev_with_alias .by_path [1 ])
195+ local dev = find_all (dev_with_alias .path_aliases [1 ])
196196 assert .Table (dev ) --- @cast dev -?
197197 assert .Equal (1 , # dev )
198198 assert .Equal (dev_with_alias .path , dev [1 ].path )
0 commit comments