BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
cf26f27d
Unverified
Commit
cf26f27d
authored
Nov 30, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated diff spec
parent
386cbf22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
+31
-31
diff_spec.js
spec/javascripts/repo/lib/diff/diff_spec.js
+31
-31
No files found.
spec/javascripts/repo/lib/diff/diff_spec.js
View file @
cf26f27d
...
@@ -10,71 +10,71 @@ describe('Multi-file editor library diff calculator', () => {
...
@@ -10,71 +10,71 @@ describe('Multi-file editor library diff calculator', () => {
describe
(
'modified'
,
()
=>
{
describe
(
'modified'
,
()
=>
{
it
(
''
,
()
=>
{
it
(
''
,
()
=>
{
const
diff
=
computeDiff
(
'123'
,
'1234'
);
const
diff
=
computeDiff
(
'123'
,
'1234'
)
[
0
]
;
expect
(
diff
[
0
]
.
added
).
toBeTruthy
();
expect
(
diff
.
added
).
toBeTruthy
();
expect
(
diff
[
0
]
.
modified
).
toBeTruthy
();
expect
(
diff
.
modified
).
toBeTruthy
();
expect
(
diff
[
0
]
.
removed
).
toBeUndefined
();
expect
(
diff
.
removed
).
toBeUndefined
();
});
});
it
(
''
,
()
=>
{
it
(
''
,
()
=>
{
const
diff
=
computeDiff
(
'123
\
n123
\
n123'
,
'123
\
n1234
\
n123'
);
const
diff
=
computeDiff
(
'123
\
n123
\
n123'
,
'123
\
n1234
\
n123'
)
[
0
]
;
expect
(
diff
[
0
]
.
added
).
toBeTruthy
();
expect
(
diff
.
added
).
toBeTruthy
();
expect
(
diff
[
0
]
.
modified
).
toBeTruthy
();
expect
(
diff
.
modified
).
toBeTruthy
();
expect
(
diff
[
0
]
.
removed
).
toBeUndefined
();
expect
(
diff
.
removed
).
toBeUndefined
();
expect
(
diff
[
0
]
.
lineNumber
).
toBe
(
2
);
expect
(
diff
.
lineNumber
).
toBe
(
2
);
});
});
});
});
describe
(
'added'
,
()
=>
{
describe
(
'added'
,
()
=>
{
it
(
''
,
()
=>
{
it
(
''
,
()
=>
{
const
diff
=
computeDiff
(
'123'
,
'123
\
n123'
);
const
diff
=
computeDiff
(
'123'
,
'123
\
n123'
)
[
0
]
;
expect
(
diff
[
0
]
.
added
).
toBeTruthy
();
expect
(
diff
.
added
).
toBeTruthy
();
expect
(
diff
[
0
]
.
modified
).
toBeUndefined
();
expect
(
diff
.
modified
).
toBeUndefined
();
expect
(
diff
[
0
]
.
removed
).
toBeUndefined
();
expect
(
diff
.
removed
).
toBeUndefined
();
});
});
it
(
''
,
()
=>
{
it
(
''
,
()
=>
{
const
diff
=
computeDiff
(
'123
\
n123
\
n123'
,
'123
\
n123
\
n1234
\
n123'
);
const
diff
=
computeDiff
(
'123
\
n123
\
n123'
,
'123
\
n123
\
n1234
\
n123'
)
[
0
]
;
expect
(
diff
[
0
]
.
added
).
toBeTruthy
();
expect
(
diff
.
added
).
toBeTruthy
();
expect
(
diff
[
0
]
.
modified
).
toBeUndefined
();
expect
(
diff
.
modified
).
toBeUndefined
();
expect
(
diff
[
0
]
.
removed
).
toBeUndefined
();
expect
(
diff
.
removed
).
toBeUndefined
();
expect
(
diff
[
0
]
.
lineNumber
).
toBe
(
3
);
expect
(
diff
.
lineNumber
).
toBe
(
3
);
});
});
});
});
describe
(
'removed'
,
()
=>
{
describe
(
'removed'
,
()
=>
{
it
(
''
,
()
=>
{
it
(
''
,
()
=>
{
const
diff
=
computeDiff
(
'123'
,
''
);
const
diff
=
computeDiff
(
'123'
,
''
)
[
0
]
;
expect
(
diff
[
0
]
.
added
).
toBeUndefined
();
expect
(
diff
.
added
).
toBeUndefined
();
expect
(
diff
[
0
]
.
modified
).
toBeUndefined
();
expect
(
diff
.
modified
).
toBeUndefined
();
expect
(
diff
[
0
]
.
removed
).
toBeTruthy
();
expect
(
diff
.
removed
).
toBeTruthy
();
});
});
it
(
''
,
()
=>
{
it
(
''
,
()
=>
{
const
diff
=
computeDiff
(
'123
\
n123
\
n123'
,
'123
\
n123'
);
const
diff
=
computeDiff
(
'123
\
n123
\
n123'
,
'123
\
n123'
)
[
0
]
;
expect
(
diff
[
0
]
.
added
).
toBeUndefined
();
expect
(
diff
.
added
).
toBeUndefined
();
expect
(
diff
[
0
]
.
modified
).
toBeTruthy
();
expect
(
diff
.
modified
).
toBeTruthy
();
expect
(
diff
[
0
]
.
removed
).
toBeTruthy
();
expect
(
diff
.
removed
).
toBeTruthy
();
expect
(
diff
[
0
]
.
lineNumber
).
toBe
(
2
);
expect
(
diff
.
lineNumber
).
toBe
(
2
);
});
});
});
});
it
(
'includes line number of change'
,
()
=>
{
it
(
'includes line number of change'
,
()
=>
{
const
diff
=
computeDiff
(
'123'
,
''
);
const
diff
=
computeDiff
(
'123'
,
''
)
[
0
]
;
expect
(
diff
[
0
]
.
lineNumber
).
toBe
(
1
);
expect
(
diff
.
lineNumber
).
toBe
(
1
);
});
});
it
(
'includes end line number of change'
,
()
=>
{
it
(
'includes end line number of change'
,
()
=>
{
const
diff
=
computeDiff
(
'123'
,
''
);
const
diff
=
computeDiff
(
'123'
,
''
)
[
0
]
;
expect
(
diff
[
0
]
.
endLineNumber
).
toBe
(
1
);
expect
(
diff
.
endLineNumber
).
toBe
(
1
);
});
});
});
});
});
});
Write
Preview
Markdown
is supported
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