Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Datree
Commits
9f7c1f7b
Commit
9f7c1f7b
authored
4 years ago
by
myishay
Browse files
Options
Download
Email Patches
Plain Diff
test: files
parent
1eaa48a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bl/files/files_test.go
+10
-10
bl/files/files_test.go
with
10 additions
and
10 deletions
+10
-10
bl/files/files_test.go
+
10
-
10
View file @
9f7c1f7b
...
...
@@ -10,14 +10,14 @@ import (
type
toAbsolutePathsTestCase
struct
{
name
string
args
struct
{
path
s
[]
string
path
string
}
expected
struct
{
path
string
}
}
func
TestToAbsolutePath
s
(
t
*
testing
.
T
)
{
func
TestToAbsolutePath
(
t
*
testing
.
T
)
{
tests
:=
[]
*
toAbsolutePathsTestCase
{
test_existed_file
(),
test_directory_file
(),
...
...
@@ -25,8 +25,8 @@ func TestToAbsolutePaths(t *testing.T) {
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
pathsChan
:=
ToAbsolutePath
s
(
tt
.
args
.
path
s
)
assert
.
Equal
(
t
,
tt
.
expected
.
path
,
<-
pathsChan
)
absolutePath
,
_
:=
ToAbsolutePath
(
tt
.
args
.
path
)
assert
.
Equal
(
t
,
tt
.
expected
.
path
,
absolutePath
)
})
}
...
...
@@ -36,8 +36,8 @@ func test_existed_file() *toAbsolutePathsTestCase {
p
,
_
:=
filepath
.
Abs
(
"../../internal/fixtures/kube/pass-all.yaml"
)
return
&
toAbsolutePathsTestCase
{
name
:
"existed file, should return abs path with no errors"
,
args
:
struct
{
path
s
[]
string
}{
path
s
:
[]
string
{
"../../internal/fixtures/kube/pass-all.yaml"
}
,
args
:
struct
{
path
string
}{
path
:
"../../internal/fixtures/kube/pass-all.yaml"
,
},
expected
:
struct
{
path
string
...
...
@@ -50,8 +50,8 @@ func test_existed_file() *toAbsolutePathsTestCase {
func
test_not_existed_file
()
*
toAbsolutePathsTestCase
{
return
&
toAbsolutePathsTestCase
{
name
:
"test not existed file, should return an error"
,
args
:
struct
{
path
s
[]
string
}{
path
s
:
[]
string
{
"../../internal/fixtures/kube/bla.yaml"
}
,
args
:
struct
{
path
string
}{
path
:
"../../internal/fixtures/kube/bla.yaml"
,
},
expected
:
struct
{
path
string
...
...
@@ -63,8 +63,8 @@ func test_not_existed_file() *toAbsolutePathsTestCase {
func
test_directory_file
()
*
toAbsolutePathsTestCase
{
return
&
toAbsolutePathsTestCase
{
args
:
struct
{
path
s
[]
string
}{
path
s
:
[]
string
{
"../../internal/fixtures/kube"
}
,
args
:
struct
{
path
string
}{
path
:
"../../internal/fixtures/kube"
,
},
expected
:
struct
{
path
string
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment