-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tobias Pflug
committed
Apr 26, 2016
1 parent
717438c
commit 2804380
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
var eq = require('./utils').eq; | ||
var S = require('..'); | ||
|
||
describe('append', function() { | ||
|
||
it('adds the element to the end of the list', function() { | ||
eq(S.append('c', ['a', 'b']), ['a', 'b', 'c']); | ||
eq(S.append({x: 3}, [{x: 1}, {x: 2}]), [{x: 1}, {x: 2}, {x: 3}]); | ||
}); | ||
|
||
it('adds a list to a list of lists', function() { | ||
eq(S.append([3, 4], [[1], [2]]), [[1], [2], [3, 4]]); | ||
}); | ||
|
||
it('works on empty list', function() { | ||
eq(S.append(1, []), [1]); | ||
}); | ||
|
||
}); |