mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-20 19:16:47 +01:00
lncli: strip prefix from pay_req flag
This commit is contained in:
@@ -3,6 +3,8 @@ package main
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var now = time.Date(2017, 11, 10, 7, 8, 9, 1234, time.UTC)
|
||||
@@ -86,3 +88,30 @@ func TestParseTime(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var stripPrefixTests = []struct {
|
||||
in string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
"lightning:ln123",
|
||||
"ln123",
|
||||
},
|
||||
{
|
||||
"lightning: ln123",
|
||||
"ln123",
|
||||
},
|
||||
{
|
||||
"ln123",
|
||||
"ln123",
|
||||
},
|
||||
}
|
||||
|
||||
func TestStripPrefix(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for _, test := range stripPrefixTests {
|
||||
actual := stripPrefix(test.in)
|
||||
require.Equal(t, test.expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user