File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ language : java
2+
3+ sudo : false
4+
5+ jdk :
6+ - oraclejdk8
7+
8+ script :
9+ - jdk_switcher use oraclejdk7 && export JAVA7_HOME=$JAVA_HOME
10+ - jdk_switcher use oraclejdk8 && export JAVA8_HOME=$JAVA_HOME
11+ - ./gradlew build --stacktrace --info
Original file line number Diff line number Diff line change 11= Functional Java
22
3+ image:https://travis-ci.org/functionaljava/functionaljava.svg?branch=master["Build Status", link="https://travis-ci.org/functionaljava/functionaljava"]
4+
35image::http://www.functionaljava.org/img/logo-600x144.png[]
46
57Functional Java is an open source library facilitating functional programming in Java. The library implements numerous basic and advanced programming abstractions that assist composition oriented development. Functional Java also serves as a platform for learning functional programming concepts by introducing these concepts using a familiar language.
@@ -98,4 +100,4 @@ A more complete description of the features mentioned above are:
98100
99101== License
100102
101- link:etc/LICENCE[The Functional Java license] uses the BSD 3 license (3-clause license) available at https://en.wikipedia.org/wiki/BSD_licenses[].
103+ link:etc/LICENCE[The Functional Java license] uses the BSD 3 license (3-clause license) available at https://en.wikipedia.org/wiki/BSD_licenses[].
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ object Tests {
2929
3030 def run (tests : List [(String , Prop )]) =
3131 tests foreach { case (name, p) => {
32- val c = check(new Test .Parameters .Default { }, p)
32+ val c = check(new Test .Parameters .Default { override val maxSize = 20 }, p)
3333 c.status match {
3434 case Test .Passed => println(" Passed " + name)
3535 case Test .Proved (_) => println(" Proved " + name)
Original file line number Diff line number Diff line change @@ -107,9 +107,11 @@ object CheckArray extends Properties("Array") {
107107 a.reverse.reverse,
108108 a))
109109
110- property(" reverse" ) = forAll((a : Array [String ], n : Int ) =>
111- (n >= 0 && n < a.length) ==>
112- (a.reverse.get(n) == a.get(a.length - 1 - n)))
110+ property(" reverse" ) = forAll((a : Array [String ], x : Byte ) =>
111+ (a.length > 0 ) ==> {
112+ val n = math.abs(x) % a.length
113+ (a.reverse.get(n) == a.get(a.length - 1 - n))
114+ })
113115
114116 property(" appendLeftIdentity" ) = forAll((a : Array [String ]) =>
115117 arrayEqual(stringEqual).eq(a.append(empty[String ]), a))
@@ -123,9 +125,11 @@ object CheckArray extends Properties("Array") {
123125 property(" appendLength" ) = forAll((a : Array [String ], b : Array [String ]) =>
124126 a.append(b).length == a.length + b.length)
125127
126- property(" array" ) = forAll((a : scala.Array [String ], n : Int ) =>
127- (n >= 0 && n < a.length) ==>
128- (array[String ](a : _* ).length == a.length && array[String ](a : _* ).get(n) == a(n)))
128+ property(" array" ) = forAll((a : scala.Array [String ], x : Byte ) =>
129+ (a.length > 0 ) ==> {
130+ val n = math.abs(x) % a.length
131+ array[String ](a : _* ).length == a.length && array[String ](a : _* ).get(n) == a(n)
132+ })
129133
130134 property(" join" ) = forAll((a : Array [Array [String ]]) =>
131135 arrayEqual(stringEqual).eq(
Original file line number Diff line number Diff line change @@ -27,11 +27,10 @@ object CheckIteratee extends Properties("Iteratee") {
2727 property(" head" ) = forAll((a : List [Int ]) =>
2828 enumerate(a, IterV .head[Int ]).run == a.toOption)
2929
30- property(" drop" ) = forAll((a : List [String ], n : Int ) => {
31- (n >= 0 && n <= a.length) ==> {
32- val actual = enumerate(a, IterV .drop(n).bind(Function .constant(IterV .list[String ]))).run.reverse
33- listEqual(stringEqual).eq(actual, a.drop(n))
34- }
30+ property(" drop" ) = forAll((a : List [String ], x : Byte ) => (a.length > 0 ) ==> {
31+ val n = math.abs(x) % a.length
32+ val actual = enumerate(a, IterV .drop(n).bind(Function .constant(IterV .list[String ]))).run.reverse
33+ listEqual(stringEqual).eq(actual, a.drop(n))
3534 })
3635
3736 property(" list" ) = forAll((a : List [String ]) =>
Original file line number Diff line number Diff line change @@ -118,9 +118,11 @@ object CheckList extends Properties("List") {
118118 (a append b).reverse,
119119 b.reverse.append(a.reverse)))
120120
121- property(" index" ) = forAll((a : List [String ], n : Int ) =>
122- (n > 0 && n < a.length) ==>
123- (a.index(n) == a.tail.index(n - 1 )))
121+ property(" index" ) = forAll((a : List [String ], x : Byte ) =>
122+ (a.length > 0 ) ==> {
123+ val n = math.abs(x) % a.length + 1
124+ (n < a.length) ==> (a.index(n) == a.tail.index(n - 1 ))
125+ })
124126
125127 property(" snoc" ) = forAll((a : List [String ], s : String ) =>
126128 listEqual(stringEqual).eq(
Original file line number Diff line number Diff line change @@ -128,9 +128,11 @@ object CheckStream extends Properties("Stream") {
128128 (a append b).reverse,
129129 b.reverse.append(a.reverse)))
130130
131- property(" index" ) = forAll((a : Stream [String ], n : Int ) =>
132- (n > 0 && n < a.length) ==>
133- (a.index(n) == a.tail._1.index(n - 1 )))
131+ property(" index" ) = forAll((a : Stream [String ], x : Byte ) =>
132+ (a.length > 0 ) ==> {
133+ val n = math.abs(x) % a.length + 1
134+ (n < a.length) ==> (a.index(n) == a.tail._1.index(n - 1 ))
135+ })
134136
135137 property(" forall" ) = forAll((a : Stream [Int ]) =>
136138 a.forall((x : Int ) => ((x % 2 == 0 ): java.lang.Boolean )) ==
You can’t perform that action at this time.
0 commit comments