Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmcclean committed Dec 6, 2016
1 parent 69bb8b6 commit 763da11
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Optional;
import java.util.function.Function;
Expand Down Expand Up @@ -33,7 +34,12 @@ public <T> LazyFluentCollectionX<T> of(T... values) {
return list;

}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}
@Test
public void onEmptySwitch() {
assertThat((LazyPOrderedSetX)ClojureTreePOrderedSet.empty((Comparator)Comparator.naturalOrder())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.aol.cyclops.clojure.collections.extension;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -32,6 +34,14 @@ public <T> LazyFluentCollectionX<T> of(T... values) {
return list;

}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}



@Test
public void onEmptySwitch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -32,6 +33,12 @@ public <T> LazyFluentCollectionX<T> of(T... values) {
return list;

}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}

@Test
public void onEmptySwitch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -32,6 +33,12 @@ public <T> LazyFluentCollectionX<T> of(T... values) {
return list;

}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}

@Test
public void onEmptySwitch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -42,6 +43,12 @@ public void onEmptySwitch() {
equalTo(LazyPOrderedSetX.of(1, 2, 3)));
}

@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}
/*
* (non-Javadoc)
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -39,6 +40,12 @@ public void onEmptySwitch() {
.onEmptySwitch(() -> LazyPSetX.of(1, 2, 3)).toList(),
equalTo(JavaSlangPSet.of(1, 2, 3).toList()));
}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}

/*
* (non-Javadoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -30,6 +31,12 @@ public <T> LazyFluentCollectionX<T> of(T... values) {
return list;

}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}

@Test
public void onEmptySwitch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -30,6 +31,12 @@ public <T> LazyFluentCollectionX<T> of(T... values) {
return list;

}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}

@Test
public void onEmptySwitch() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package com.aol.cyclops.reactor.collections.extensions.standard;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;

import org.jooq.lambda.tuple.Tuple2;
import org.junit.Test;

import com.aol.cyclops.data.collections.extensions.FluentCollectionX;
import com.aol.cyclops.reactor.collections.extensions.AbstractCollectionXTest;
Expand All @@ -17,7 +22,12 @@ public class LazySetXTest extends AbstractCollectionXTest{
public <T> LazyFluentCollectionX<T> of(T... values) {
return LazySetX.of(values);
}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}
/* (non-Javadoc)
* @see com.aol.cyclops.functions.collections.extensions.AbstractCollectionXTest#empty()
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package com.aol.cyclops.reactor.collections.extensions.standard;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;

import org.jooq.lambda.tuple.Tuple2;
import org.junit.Test;

import com.aol.cyclops.data.collections.extensions.FluentCollectionX;
import com.aol.cyclops.reactor.collections.extensions.AbstractCollectionXTest;
Expand All @@ -17,6 +22,12 @@ public class LazySortedSetXTest extends AbstractCollectionXTest{
public <T> LazyFluentCollectionX<T> of(T... values) {
return LazySortedSetX.of(values);
}
@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}

/* (non-Javadoc)
* @see com.aol.cyclops.functions.collections.extensions.AbstractCollectionXTest#empty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand All @@ -22,6 +23,12 @@

public class LazyPOrderedSetXTest extends AbstractCollectionXTest {

@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}
@Override
public <T> LazyFluentCollectionX<T> of(T... values) {
LazyPOrderedSetX<T> list = (LazyPOrderedSetX)ScalaTreePOrderedSet.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
Expand All @@ -22,6 +23,12 @@

public class LazyPSetXTest extends AbstractCollectionXTest {

@Test
public void forEach2() {

assertThat(of(1, 2, 3).forEach2(a -> Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (a, b) -> a + b).size(),
equalTo(12));
}
@Override
public <T> LazyFluentCollectionX<T> of(T... values) {
LazyPSetX<T> list = ScalaHashPSet.empty();
Expand Down

0 comments on commit 763da11

Please sign in to comment.