Skip to content

Commit 523a084

Browse files
committed
add current path test
1 parent 9457583 commit 523a084

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pkg/remote/connparse/connparse_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,28 @@ func TestParseURI_WSHCurrentPath(t *testing.T) {
212212
if c.GetFullURI() != expected {
213213
t.Fatalf("expected full URI to be %q, got %q", expected, c.GetFullURI())
214214
}
215+
216+
cstr = "path/to/file"
217+
c, err = connparse.ParseURI(cstr)
218+
if err != nil {
219+
t.Fatalf("failed to parse URI: %v", err)
220+
}
221+
expected = "path/to/file"
222+
if c.Path != expected {
223+
t.Fatalf("expected path to be %q, got %q", expected, c.Path)
224+
}
225+
expected = "current"
226+
if c.Host != expected {
227+
t.Fatalf("expected host to be %q, got %q", expected, c.Host)
228+
}
229+
expected = "wsh"
230+
if c.Scheme != expected {
231+
t.Fatalf("expected scheme to be %q, got %q", expected, c.Scheme)
232+
}
233+
expected = "wsh://current/path/to/file"
234+
if c.GetFullURI() != expected {
235+
t.Fatalf("expected full URI to be %q, got %q", expected, c.GetFullURI())
236+
}
215237
}
216238

217239
func TestParseURI_WSHCurrentPathWindows(t *testing.T) {

0 commit comments

Comments
 (0)