Skip to content

Commit 3a946c4

Browse files
authored
Merge pull request #47 from cquiroz/format_tests
Port format tests
2 parents 0f401be + 091846e commit 3a946c4

File tree

75 files changed

+7288
-5809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+7288
-5809
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def copyAndReplace(srcDirs: Seq[File], destinationDir: File): Seq[File] = {
114114
.replaceAll("package org.threeten$", "package java")
115115
.replaceAll("package object bp", "package object time")
116116
.replaceAll("package org.threeten.bp", "package java.time")
117-
.replaceAll("import org.threeten.bp", "import java.time")
117+
.replaceAll("""import org.threeten.bp(\..*)?(\.[A-Z_{][^\.]*)""", "import java.time$1$2")
118118
.replaceAll("import zonedb.threeten", "import zonedb.java")
119119
.replaceAll("private\\s*\\[bp\\]", "private[time]")
120120
}

js/src/main/scala/org/threeten/bp/zone/TzdbZoneRulesProvider.scala

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
package org.threeten.bp.zone
22

3-
import org.threeten.bp._
3+
import org.threeten.bp.LocalTime
4+
import org.threeten.bp.LocalDateTime
5+
import org.threeten.bp.LocalDate
6+
import org.threeten.bp.ZoneOffset
7+
import org.threeten.bp.DayOfWeek
8+
import org.threeten.bp.Month
9+
import org.threeten.bp.DateTimeException
10+
411
import scala.scalajs.js
512

613
final class TzdbZoneRulesProvider extends ZoneRulesProvider {
@@ -10,7 +17,16 @@ final class TzdbZoneRulesProvider extends ZoneRulesProvider {
1017
private val stdZonesMap = stdZones.asInstanceOf[js.Dictionary[js.Dynamic]].toMap
1118
private val fixedZonesMap = fixedZones.asInstanceOf[js.Dictionary[Int]].toMap
1219

13-
override protected def provideZoneIds: java.util.Set[String] = new java.util.HashSet((stdZonesMap.keySet ++ fixedZonesMap.keySet ++ zoneLinks.keySet).asJava)
20+
override protected def provideZoneIds: java.util.Set[String] = {
21+
val zones = new java.util.HashSet((stdZonesMap.keySet ++ fixedZonesMap.keySet ++ zoneLinks.keySet).asJava)
22+
// I'm not totallly sure the reason why but TTB removes these ZoneIds
23+
zones.remove("UTC")
24+
zones.remove("GMT")
25+
zones.remove("GMT0")
26+
zones.remove("GMT+0")
27+
zones.remove("GMT-0")
28+
zones
29+
}
1430

1531
private def toLocalTime(lt: Int): LocalTime =
1632
LocalTime.ofSecondOfDay(lt)

js/src/test/scala/org/threeten/bp/Platform.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.threeten.bp
22

33
object Platform {
44
type NPE = scala.scalajs.js.JavaScriptException
5+
type DFE = scala.scalajs.runtime.UndefinedBehaviorError
56

67
/** Returns `true` if and only if the code is executing on a JVM.
78
* Note: Returns `false` when executing on any JS VM.

jvm/src/test/scala/org/threeten/bp/Platform.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.threeten.bp
22

33
object Platform {
44
type NPE = NullPointerException
5+
type DFE = IndexOutOfBoundsException
56

67
/** Returns `true` if and only if the code is executing on a JVM.
78
* Note: Returns `false` when executing on any JS VM.

jvm/src/test/scala/org/threeten/bp/format/TestCharLiteralParser.scala

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

0 commit comments

Comments
 (0)