Skip to content

Port format tests #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
May 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
28dafb6
Ported TestCharLiteralParser
cquiroz Feb 25, 2017
f4ee958
Ported TestCharLiteralPrinter
cquiroz Feb 25, 2017
8746b81
Workaround for broken test on scala.js
cquiroz Feb 25, 2017
a676cac
Port TestNumberParser to scalatest
cquiroz Feb 26, 2017
4b02828
Ported TestNumberPrinter to scalatest
cquiroz Feb 27, 2017
9060793
Refactor in progress
cquiroz Apr 10, 2017
7989330
Large refactoring to support testing on JVM and JS and on packages or…
cquiroz Apr 25, 2017
85a9209
Fixed tests that break when run in the java.time package
cquiroz Apr 26, 2017
b186599
Ported TestSettingsParser
cquiroz Apr 26, 2017
a983a23
Port of TestFractionPrinterParser
cquiroz Apr 27, 2017
cf0006f
Port of TestDateTimeFormatterBuilder
cquiroz Apr 28, 2017
d692e15
Ported TestZoneOffsetPrinter to scalatest
cquiroz Apr 28, 2017
1e878ac
Ported TestDateTimeFormatter to scalatest
cquiroz Apr 28, 2017
f8ce32e
Port TestDateTimeBuilderCombinations to scalatest
cquiroz Apr 29, 2017
a524b58
Port TestZoneIdParser to scalatest
cquiroz Apr 29, 2017
d2cdeb0
Port TestReducedPrinter to scalatest
cquiroz Apr 29, 2017
fb7b752
Port TestDateTimeFormatters to scalatest
cquiroz Apr 29, 2017
a882cc1
Improve query method signature
cquiroz May 1, 2017
5f4f659
Port TestZoneOffsetParser
cquiroz May 1, 2017
e0c74d6
Port TestDateTimeParsing to scalatest
cquiroz May 2, 2017
9748b63
Ported TestPadParserDecorator to scalatest
cquiroz May 2, 2017
09a7a2b
Ported TestPadPrinterDecorator to scalatest
cquiroz May 2, 2017
3a67868
Port TestReducedParser to scalatest
cquiroz May 2, 2017
851f913
Port TestStringLiteralParser to scalatest
cquiroz May 2, 2017
e17d9d6
Port TestStringLiteralParser to scalatest
cquiroz May 2, 2017
1a995a0
Port TestTextParser to scalatest
cquiroz May 2, 2017
4047993
Port TestTextPrinter to scalatest
cquiroz May 2, 2017
0237131
Remove unused AbstractTestPrinterParser
cquiroz May 2, 2017
506a779
Cosmetic improvements
cquiroz May 2, 2017
091846e
Fix unimplemented methods
cquiroz May 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def copyAndReplace(srcDirs: Seq[File], destinationDir: File): Seq[File] = {
.replaceAll("package org.threeten$", "package java")
.replaceAll("package object bp", "package object time")
.replaceAll("package org.threeten.bp", "package java.time")
.replaceAll("import org.threeten.bp", "import java.time")
.replaceAll("""import org.threeten.bp(\..*)?(\.[A-Z_{][^\.]*)""", "import java.time$1$2")
.replaceAll("import zonedb.threeten", "import zonedb.java")
.replaceAll("private\\s*\\[bp\\]", "private[time]")
}
Expand Down
20 changes: 18 additions & 2 deletions js/src/main/scala/org/threeten/bp/zone/TzdbZoneRulesProvider.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
package org.threeten.bp.zone

import org.threeten.bp._
import org.threeten.bp.LocalTime
import org.threeten.bp.LocalDateTime
import org.threeten.bp.LocalDate
import org.threeten.bp.ZoneOffset
import org.threeten.bp.DayOfWeek
import org.threeten.bp.Month
import org.threeten.bp.DateTimeException

import scala.scalajs.js

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

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

private def toLocalTime(lt: Int): LocalTime =
LocalTime.ofSecondOfDay(lt)
Expand Down
1 change: 1 addition & 0 deletions js/src/test/scala/org/threeten/bp/Platform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.threeten.bp

object Platform {
type NPE = scala.scalajs.js.JavaScriptException
type DFE = scala.scalajs.runtime.UndefinedBehaviorError

/** Returns `true` if and only if the code is executing on a JVM.
* Note: Returns `false` when executing on any JS VM.
Expand Down
1 change: 1 addition & 0 deletions jvm/src/test/scala/org/threeten/bp/Platform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.threeten.bp

object Platform {
type NPE = NullPointerException
type DFE = IndexOutOfBoundsException

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

This file was deleted.

Loading