@@ -27,25 +27,25 @@ import (
2727var (
2828 portsNoBoards = []* rpc.DetectedPort {
2929 {
30- Address : "ACM0" ,
31- Boards : []* rpc.BoardListItem {},
30+ Port : & rpc. Port { Address : "ACM0" } ,
31+ MatchingBoards : []* rpc.BoardListItem {},
3232 },
3333 {
34- Address : "ACM1" ,
35- Boards : []* rpc.BoardListItem {},
34+ Port : & rpc. Port { Address : "ACM1" } ,
35+ MatchingBoards : []* rpc.BoardListItem {},
3636 },
3737 }
3838
3939 portsTwoBoards = []* rpc.DetectedPort {
4040 {
41- Address : "ACM0" ,
42- Boards : []* rpc.BoardListItem {
41+ Port : & rpc. Port { Address : "ACM0" } ,
42+ MatchingBoards : []* rpc.BoardListItem {
4343 {Fqbn : "arduino:samd:nano_33_iot" },
4444 },
4545 },
4646 {
47- Address : "ACM1" ,
48- Boards : []* rpc.BoardListItem {
47+ Port : & rpc. Port { Address : "ACM1" } ,
48+ MatchingBoards : []* rpc.BoardListItem {
4949 {Fqbn : "arduino:avr:uno" },
5050 },
5151 },
@@ -68,14 +68,14 @@ func TestBoardFromPorts(t *testing.T) {
6868 name : "port-filter" ,
6969 filter : & CreateParams {FQBN : nil , Port : stringPointer ("ACM1" )},
7070 ports : portsTwoBoards ,
71- want : & board {fqbn : "arduino:avr:uno" , port : "ACM1" },
71+ want : & board {fqbn : "arduino:avr:uno" , address : "ACM1" },
7272 },
7373
7474 {
7575 name : "fqbn-filter" ,
7676 filter : & CreateParams {FQBN : stringPointer ("arduino:avr:uno" ), Port : nil },
7777 ports : portsTwoBoards ,
78- want : & board {fqbn : "arduino:avr:uno" , port : "ACM1" },
78+ want : & board {fqbn : "arduino:avr:uno" , address : "ACM1" },
7979 },
8080
8181 {
@@ -90,7 +90,7 @@ func TestBoardFromPorts(t *testing.T) {
9090 filter : & CreateParams {FQBN : nil , Port : nil },
9191 ports : portsTwoBoards ,
9292 // first board found is selected
93- want : & board {fqbn : "arduino:samd:nano_33_iot" , port : "ACM0" },
93+ want : & board {fqbn : "arduino:samd:nano_33_iot" , address : "ACM0" },
9494 },
9595
9696 {
@@ -104,7 +104,7 @@ func TestBoardFromPorts(t *testing.T) {
104104 name : "both-filter-found" ,
105105 filter : & CreateParams {FQBN : stringPointer ("arduino:avr:uno" ), Port : stringPointer ("ACM1" )},
106106 ports : portsTwoBoards ,
107- want : & board {fqbn : "arduino:avr:uno" , port : "ACM1" },
107+ want : & board {fqbn : "arduino:avr:uno" , address : "ACM1" },
108108 },
109109
110110 {
@@ -123,14 +123,14 @@ func TestBoardFromPorts(t *testing.T) {
123123 return
124124
125125 } else if got != nil && tt .want == nil {
126- t .Errorf ("Expected nil board, received not nil board with port %s and fqbn %s" , got .port , got .fqbn )
126+ t .Errorf ("Expected nil board, received not nil board with port %s and fqbn %s" , got .address , got .fqbn )
127127
128128 } else if got == nil && tt .want != nil {
129- t .Errorf ("Expected not nil board with port %s and fqbn %s, received a nil board" , tt .want .port , tt .want .fqbn )
129+ t .Errorf ("Expected not nil board with port %s and fqbn %s, received a nil board" , tt .want .address , tt .want .fqbn )
130130
131- } else if got .port != tt .want .port || got .fqbn != tt .want .fqbn {
131+ } else if got .address != tt .want .address || got .fqbn != tt .want .fqbn {
132132 t .Errorf ("Expected board with port %s and fqbn %s, received board with port %s and fqbn %s" ,
133- tt .want .port , tt .want .fqbn , got .port , got .fqbn )
133+ tt .want .address , tt .want .fqbn , got .address , got .fqbn )
134134 }
135135 })
136136 }
0 commit comments