Skip to content

Commit

Permalink
Collection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioAriasC committed Aug 1, 2015
1 parent 5afc3bd commit 39babdb
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Then you can use funKTionale dependency
<dependency>
<groupId>org.funktionale</groupId>
<artifactId>funktionale</artifactId>
<version>0.5.1.1_M12</version>
<version>0.6_M12</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<groupId>org.funktionale</groupId>
<artifactId>funktionale</artifactId>
<version>0.5.1.1_M12</version>
<version>0.6_M12</version>
<packaging>jar</packaging>
<name>funKTionale</name>
<description>Functional constructs and utilities for Kotlin</description>
Expand Down
31 changes: 31 additions & 0 deletions src/test/kotlin/org/funktionale/collections/CollectionsTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2013 Mario Arias
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.funktionale.collections

import org.testng.Assert
import org.testng.annotations.Test


public class CollectionsTest {
@Test fun tail() {
Assert.assertEquals(listOf(1, 2, 3).tail(), listOf(2, 3))
}

@Test fun prependTo() {
Assert.assertEquals(1 prependTo listOf(2, 3), listOf(1, 2, 3))
}
}
17 changes: 8 additions & 9 deletions src/test/kotlin/org/funktionale/utils/UtilTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

package org.funktionale.utils

import org.funktionale.collections.prependTo
import org.funktionale.collections.tail
import org.testng.Assert.assertEquals
import org.testng.annotations.Test
import org.testng.Assert.*

public class UtilTest {

Expand Down Expand Up @@ -48,15 +50,15 @@ public class UtilTest {
}

val Greeter.receive: SetterOperation<String, String>
get(){
return SetterOperationImpl{ k, v ->
get() {
return SetterOperationImpl { k, v ->
this.receiveHello(k, v)
}
}

val Greeter.sayHello: GetterOperation<String, String>
get(){
return GetterOperationImpl{ k ->
get() {
return GetterOperationImpl { k ->
this.sayHelloTo(k)
}
}
Expand All @@ -73,10 +75,7 @@ public class UtilTest {
}





class Greeter{
class Greeter {

var hello: String? = null
var name: String? = null
Expand Down

0 comments on commit 39babdb

Please sign in to comment.