java-cons

This small, one interface project is a try to reimplement the mechanics used in Rackets cons cells in Java.
git clone git://git.oshgnacknak.de/java-cons.git
Log | Files | Refs | README

commit 29eaefbe7c14eab38d92430359fea528f0e15bab
parent d9fc77bd641ab1815d3421e60797128a6af3c2df
Author: Oshgnacknak <osh@oshgnacknak.de>
Date:   Fri, 15 Jan 2021 00:38:01 +0100

prefix tests with test

Diffstat:
Msrc/NonEmptyTest.java | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/NonEmptyTest.java b/src/NonEmptyTest.java @@ -8,12 +8,12 @@ class NonEmptyTest { Cons<String> stringCons = new NonEmpty<>("Hallo", new NonEmpty<>("Welt", new Empty<>())); @Test - void first() { + void testFirst() { assertEquals(1, cons.first()); } @Test - void rest() { + void testRest() { var expected = new NonEmpty<>(2, new NonEmpty<>(3, new Empty<>())); assertEquals(expected, cons.rest()); @@ -25,7 +25,7 @@ class NonEmptyTest { } @Test - void map() { + void testMap() { var expected = new NonEmpty<>(1, new NonEmpty<>(4, new NonEmpty<>(9, new Empty<>()))); assertEquals(expected, cons.map(n -> n*n)); @@ -34,7 +34,7 @@ class NonEmptyTest { } @Test - void filter() { + void testFilter() { var expected = new NonEmpty<>(1, new NonEmpty<>(3, new Empty<>())); assertEquals(expected, cons.filter(n -> n % 2 == 1)); assertEquals(new Empty<>(), cons.filter(n -> n > 10)); @@ -44,13 +44,13 @@ class NonEmptyTest { } @Test - void foldl() { + void testFoldl() { assertEquals(6, cons.foldl(Integer::sum, 0)); assertEquals("WeltHallo", stringCons.foldl(String::concat, "")); } @Test - void foldr() { + void testFoldr() { assertEquals(6, cons.foldr(Integer::sum, 0)); assertEquals("HalloWelt", stringCons.foldr(String::concat, "")); }