Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 25, 2022. It is now read-only.
/packrPublic archive

Commitba53cc4

Browse files
hdmmarkbates
authored andcommitted
Improve test cases for file resolution (#233)
1 parentbcc60f5 commitba53cc4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎v2/box_test.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,27 +227,27 @@ func Test_Box_HasDir(t *testing.T) {
227227
funcTest_Box_Traversal_Standard(t*testing.T) {
228228
r:=require.New(t)
229229
box:=New("Test_Box_Traversal_Standard","")
230-
_,err:=box.FindString("../go.mod")
230+
_,err:=box.FindString("../fixtures/hello.txt")
231231
r.Error(err)
232232
}
233233

234234
funcTest_Box_Traversal_Standard_Depth2(t*testing.T) {
235235
r:=require.New(t)
236236
box:=New("Test_Box_Traversal_Standard_Depth2","")
237-
_,err:=box.FindString("../../packr/go.mod")
237+
_,err:=box.FindString("../../packr/fixtures/hello.txt")
238238
r.Error(err)
239239
}
240240

241241
funcTest_Box_Traversal_Backslash(t*testing.T) {
242242
r:=require.New(t)
243243
box:=New("Test_Box_Traversal_Backslash","")
244-
_,err:=box.FindString("..\\go.mod")
244+
_,err:=box.FindString("..\\fixtures\\hello.txt")
245245
r.Error(err)
246246
}
247247

248248
funcTest_Box_Traversal_Backslash_Depth2(t*testing.T) {
249249
r:=require.New(t)
250250
box:=New("Test_Box_Traversal_Backslash_Depth2","")
251-
_,err:=box.FindString("..\\..packr2\\go.mod")
251+
_,err:=box.FindString("..\\..\\packr2\\fixtures\\hello.txt")
252252
r.Error(err)
253253
}

‎v2/file/resolver/disk.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func (d *Disk) Resolve(box string, name string) (file.File, error) {
4545
returnnil,os.ErrNotExist
4646
}
4747

48-
//resolvePathInBase returns a path that is guaranteed to be inside of the base directory or an error
49-
funcResolvePathInBase(basestring,pathstring) (string,error) {
48+
//ResolvePathInBase returns a path that is guaranteed to be inside of the base directory or an error
49+
funcResolvePathInBase(base,pathstring) (string,error) {
5050
// Determine the absolute file path of the base directory
5151
d,err:=filepath.Abs(base)
5252
iferr!=nil {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp