Skip to content

Commit 975983c

Browse files
committed
- upgraded to 1.1.2-eap-73
- downgrade to groovy script
1 parent 3a9f8af commit 975983c

File tree

6 files changed

+46
-56
lines changed

6 files changed

+46
-56
lines changed

build.gradle

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apply plugin: 'maven'
2+
apply plugin: 'kotlin'
3+
4+
buildscript {
5+
6+
ext.kotlinVersion = '1.1.2-eap-73'
7+
8+
repositories {
9+
mavenCentral()
10+
maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
11+
}
12+
dependencies {
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
14+
}
15+
}
16+
17+
18+
19+
dependencies {
20+
21+
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
22+
23+
testCompile("io.kotlintest:kotlintest:2.0.0")
24+
}
25+
26+
repositories {
27+
mavenCentral()
28+
maven { url "https://jitpack.io" }
29+
maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
30+
}

build.gradle.kts

Lines changed: 0 additions & 42 deletions
This file was deleted.

gradle/wrapper/gradle-wrapper.jar

0 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Mar 09 09:58:18 CET 2017
1+
#Thu Apr 20 10:57:07 CEST 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://repo.gradle.org/gradle/dist-snapshots/gradle-script-kotlin-3.5-20170305000422+0000-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.buildFileName = 'build.gradle.kts'
1+
rootProject.buildFileName = 'build.gradle'

src/test/kotlin/unsigned/unsigned.kt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
package unsigned
22

33
import and
4-
import or
5-
import xor
64
import io.kotlintest.KTestJUnitRunner
7-
import io.kotlintest.matchers.be
5+
import io.kotlintest.matchers.beLessThan
6+
import io.kotlintest.matchers.should
7+
import io.kotlintest.matchers.shouldBe
88
import io.kotlintest.specs.StringSpec
9+
import minus
10+
import or
911
import org.junit.runner.RunWith
12+
import plus
13+
import times
1014
import toUBigInt
1115
import ucmp
1216
import udiv
1317
import urem
18+
import xor
1419
import java.math.BigInteger
1520
import kotlin.experimental.inv
16-
import plus
17-
import minus
18-
import times
1921

2022
/**
2123
* Created by elect on 15/10/16.
@@ -56,24 +58,24 @@ class Unsigned : StringSpec() {
5658

5759
250.b udiv 50.b shouldBe 5.b
5860
250.b urem 200.b shouldBe 50.b
59-
250.b ucmp 251.b should be lt 1
61+
250.b ucmp 251.b should beLessThan(1)
6062
(250.b ucmp 250.b) shouldBe 0
6163
0b1010_1010.b ushr 4 shouldBe 0b1010.b
6264

6365
65500.s udiv 500.s shouldBe 131.s
6466
65500.s urem 65000.s shouldBe 500.s
65-
65500.s ucmp 65501.s should be lt 1
67+
65500.s ucmp 65501.s should beLessThan(1)
6668
65500.s ucmp 65500.s shouldBe 0
6769
0b0100_1100_0011_1101.s ushr 8 shouldBe 0b100_1100.s
6870

6971
4_000_000_000.i udiv 2 shouldBe 2_000_000_000
7072
2_750_000_000.i urem 2_000_000_000 shouldBe 750_000_000
71-
4_000_000_000.i ucmp 4_000_000_001.i should be lt 1
73+
4_000_000_000.i ucmp 4_000_000_001.i should beLessThan(1)
7274
4_000_000_000.i ucmp 4_000_000_000.i shouldBe 0
7375

7476
"18_000_000_000_000_000_000".L udiv 2L shouldBe "9'000'000'000'000'000'000".L
7577
"17'000'000'000'000'000'000".L urem "9'000'000'000'000'000'000".L shouldBe "8'000'000'000'000'000'000".L
76-
"18'000'000'000'000'000'000".L ucmp "18'000'000'000'000'000'001".L should be lt 1
78+
"18'000'000'000'000'000'000".L ucmp "18'000'000'000'000'000'001".L should beLessThan(1)
7779
"18'000'000'000'000'000'001".L ucmp "18'000'000'000'000'000'001".L shouldBe 0
7880
}
7981

@@ -434,7 +436,7 @@ class Unsigned : StringSpec() {
434436
d = "0100_1100__0111_0000__1111_0000__0111_1100__0000_1111__1100_0000__0111_1111__0000_0000".bL
435437
d shl Ulong(32).toInt() shouldBe "0000_1111__1100_0000__0111_1111__0000_0000__0000_0000__0000_0000__0000_0000__0000_0000".bL
436438
d shr Ulong(32).toInt() shouldBe "0000_0000__0000_0000__0000_0000__0000_0000__0100_1100__0111_0000__1111_0000__0111_1100".bL
437-
(d ucmp Ulong("1010_1010__1010_1010__1010_1010__1010_1010__1010_1010__1010_1010__1010_1010__1010_1011", 2)) should be lt 0
439+
(d ucmp Ulong("1010_1010__1010_1010__1010_1010__1010_1010__1010_1010__1010_1010__1010_1010__1010_1011", 2)) should beLessThan(0)
438440
(d ucmp Ulong(d)) shouldBe 0
439441
}
440442

0 commit comments

Comments
 (0)