File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11package main
22
33import (
4- "errors "
4+ "encoding/hex "
55 "fmt"
66 "math"
77 "strconv"
@@ -52,19 +52,18 @@ func TestParseChanPoint(t *testing.T) {
5252 "3a5a467dc0bc:string" ,
5353 true ,
5454 0 ,
55- errors .New ("unable to decode output index: strconv." +
56- "ParseInt: parsing \" string\" : invalid syntax" ),
55+ strconv .ErrSyntax ,
5756 }, {
5857 "not_hex:0" ,
5958 true ,
6059 0 ,
61- errors .New ("unable to parse hex string: encoding/hex:" +
62- " invalid byte: U+006E 'n'" ),
60+ hex .InvalidByteError ('n' ),
6361 },
6462 }
6563 for _ , tc := range testCases {
6664 cp , err := parseChanPoint (tc .channelPoinStr )
67- require .Equal (t , tc .err , err )
65+ require .ErrorIs (t , err , tc .err )
66+
6867 require .Equal (t , tc .channelPointIsNil , cp == nil )
6968 if ! tc .channelPointIsNil {
7069 require .Equal (t , tc .outputIndex , cp .OutputIndex )
You can’t perform that action at this time.
0 commit comments