Skip to content

Commit f68ce24

Browse files
committed
#181: Added test case
1 parent c9d903c commit f68ce24

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package fj.data;
2+
3+
import org.junit.Test;
4+
5+
import static org.hamcrest.CoreMatchers.equalTo;
6+
import static org.junit.Assert.assertThat;
7+
8+
/**
9+
* Created by MarkPerry on 17/08/2015.
10+
*/
11+
public class ListBufferTest {
12+
13+
@Test
14+
public void testSnoc() {
15+
// test case for #181
16+
List.Buffer<Integer> buf = List.Buffer.empty();
17+
buf.snoc(1).snoc(2).snoc(3);
18+
List<Integer> list1 = buf.toList();
19+
buf.snoc(4);
20+
List<Integer> list2 = buf.toList();
21+
assertThat(list2, equalTo(Stream.range(1, 5).toList()));
22+
}
23+
24+
}

0 commit comments

Comments
 (0)