FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/test/tests/pathspec.js at master · nodegit/nodegit · GitHub
nodegit
nodegit
Repository navigation
Code
Issues
344
(344)
Pull requests
21
(21)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
test
/
tests
/
pathspec.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (33 loc) · 1.5 KB
Breadcrumbs
nodegit
/
test
/
tests
/
pathspec.js
Copy path
File metadata and controls
44 lines (33 loc) · 1.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var
assert
=
require
(
"assert"
)
;
describe
(
"Pathspec"
,
function
(
)
{
var
NodeGit
=
require
(
"../../"
)
;
var
Pathspec
=
NodeGit
.
Pathspec
;
it
(
"can accept just about anything against a * pathspec"
,
function
(
)
{
var
pathspec
=
Pathspec
.
create
(
"*"
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"burritoooo"
)
,
1
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"bob/ted/yoghurt.mp3"
)
,
1
)
;
}
)
;
it
(
"can take a * in an array"
,
function
(
)
{
var
pathspec
=
Pathspec
.
create
(
"*"
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"burritoooo"
)
,
1
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"bob/ted/yoghurt.mp3"
)
,
1
)
;
}
)
;
it
(
"can take a single file"
,
function
(
)
{
var
pathspec
=
Pathspec
.
create
(
[
"myDir/burritoSupreme.mp4"
]
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"myDir/burritoSupreme.mp4"
)
,
1
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"bob/ted/yoghurt.mp3"
)
,
0
)
;
}
)
;
it
(
"can take files in an array"
,
function
(
)
{
var
pathspec
=
Pathspec
.
create
(
[
"gwendoline.txt"
,
"sausolito.ogg"
]
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"gwendoline.txt"
)
,
1
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"sausolito.ogg"
)
,
1
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"sausolito.txt"
)
,
0
)
;
}
)
;
it
(
"can handle dirs"
,
function
(
)
{
var
pathspec
=
Pathspec
.
create
(
[
"myDir/"
,
"bob.js"
]
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"bob.js"
)
,
1
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"myDir/bob2.js"
)
,
1
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"bob2.js"
)
,
0
)
;
assert
.
equal
(
pathspec
.
matchesPath
(
0
,
"herDir/bob.js"
)
,
0
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL