@@ -37,33 +37,33 @@ defmodule Circuits.GPIO2Test do
3737 assert info . pins_open == 0
3838 end
3939
40- describe "info /2" do
40+ describe "identifiers /2" do
4141 test "all gpio_spec examples" do
4242 expected = % {
4343 location: { "gpiochip0" , 5 } ,
4444 label: "pair_2_1" ,
4545 controller: "stub0"
4646 }
4747
48- assert GPIO . info ( 5 ) == { :ok , expected }
49- assert GPIO . info ( "pair_2_1" ) == { :ok , expected }
50- assert GPIO . info ( { "gpiochip0" , 5 } ) == { :ok , expected }
51- assert GPIO . info ( { "stub0" , 5 } ) == { :ok , expected }
52- assert GPIO . info ( { "gpiochip0" , "pair_2_1" } ) == { :ok , expected }
53- assert GPIO . info ( { "stub0" , "pair_2_1" } ) == { :ok , expected }
54-
55- assert GPIO . info ( - 1 ) == { :error , :not_found }
56- assert GPIO . info ( 64 ) == { :error , :not_found }
57- assert GPIO . info ( "something" ) == { :error , :not_found }
58- assert GPIO . info ( { "gpiochip0" , 64 } ) == { :error , :not_found }
59- assert GPIO . info ( { "stub0" , 64 } ) == { :error , :not_found }
60- assert GPIO . info ( { "gpiochip0" , "something" } ) == { :error , :not_found }
61- assert GPIO . info ( { "stub0" , "something" } ) == { :error , :not_found }
48+ assert GPIO . identifiers ( 5 ) == { :ok , expected }
49+ assert GPIO . identifiers ( "pair_2_1" ) == { :ok , expected }
50+ assert GPIO . identifiers ( { "gpiochip0" , 5 } ) == { :ok , expected }
51+ assert GPIO . identifiers ( { "stub0" , 5 } ) == { :ok , expected }
52+ assert GPIO . identifiers ( { "gpiochip0" , "pair_2_1" } ) == { :ok , expected }
53+ assert GPIO . identifiers ( { "stub0" , "pair_2_1" } ) == { :ok , expected }
54+
55+ assert GPIO . identifiers ( - 1 ) == { :error , :not_found }
56+ assert GPIO . identifiers ( 64 ) == { :error , :not_found }
57+ assert GPIO . identifiers ( "something" ) == { :error , :not_found }
58+ assert GPIO . identifiers ( { "gpiochip0" , 64 } ) == { :error , :not_found }
59+ assert GPIO . identifiers ( { "stub0" , 64 } ) == { :error , :not_found }
60+ assert GPIO . identifiers ( { "gpiochip0" , "something" } ) == { :error , :not_found }
61+ assert GPIO . identifiers ( { "stub0" , "something" } ) == { :error , :not_found }
6262 end
6363
6464 test "lines in stub1" do
6565 for spec <- [ 33 , "pair_16_1" , { "stub1" , "pair_16_1" } ] do
66- info = GPIO . info ( spec )
66+ info = GPIO . identifiers ( spec )
6767
6868 expected_line_info = % {
6969 location: { "gpiochip1" , 1 } ,
@@ -78,7 +78,7 @@ defmodule Circuits.GPIO2Test do
7878
7979 test "nonexistent lines" do
8080 for spec <- [ - 1 , 65 , "pair_100_0" , { "stub10" , "pair_2_0" } ] do
81- info = GPIO . info ( spec )
81+ info = GPIO . identifiers ( spec )
8282
8383 assert info == { :error , :not_found } ,
8484 "Unexpected info for #{ inspect ( spec ) } -> #{ inspect ( info ) } "
@@ -468,13 +468,13 @@ defmodule Circuits.GPIO2Test do
468468
469469 # Set the cache to something bogus and check that it's comes back
470470 :persistent_term . put ( Circuits.GPIO.CDev , [ bogus_gpio ] )
471- assert GPIO . info ( "not_a_gpio" ) == { :ok , bogus_gpio }
471+ assert GPIO . identifiers ( "not_a_gpio" ) == { :ok , bogus_gpio }
472472
473473 # Now check that the cache gets refreshed when a gpio isn't found
474- assert GPIO . info ( "pair_18_1" ) == { :ok , good_gpio }
474+ assert GPIO . identifiers ( "pair_18_1" ) == { :ok , good_gpio }
475475
476476 # The bogus GPIO doesn't come back
477- assert GPIO . info ( "not_a_gpio" ) == { :error , :not_found }
477+ assert GPIO . identifiers ( "not_a_gpio" ) == { :error , :not_found }
478478 end
479479
480480 test "write_one/2 + read_one/1" do
0 commit comments