Skip to content

Commit

Permalink
Merge pull request #74 from Sciss/2.0.x
Browse files Browse the repository at this point in the history
fixes #73
  • Loading branch information
benhutchison authored Mar 27, 2018
2 parents 7a0176f + 9040cd1 commit 5eae857
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
10 changes: 8 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ scalaModuleSettings

name := "scala-swing"

version := "2.0.2-SNAPSHOT"
version := "2.0.3-SNAPSHOT"

scalacOptions ++= Seq("-deprecation", "-feature")

Expand All @@ -20,7 +20,13 @@ mimaPreviousVersion := Some("2.0.0")
// set the prompt (for this build) to include the project id.
shellPrompt in ThisBuild := { state => Project.extract(state).currentRef.project + "> " }

lazy val swing = project.in( file(".") )
lazy val swing = project.in(file("."))
.settings(
libraryDependencies += {
val v = if (scalaVersion.value == "2.13.0-M3") "3.0.5-M1" else "3.0.5"
"org.scalatest" %% "scalatest" % v % "test"
}
)

lazy val examples = project.in( file("examples") )
.dependsOn(swing)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.17
sbt.version=0.13.17
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.13")
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.14")
2 changes: 1 addition & 1 deletion src/main/scala/scala/swing/RichWindow.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ object Dialog {
object Result extends Enumeration {
import JOptionPane._
val Yes : Result.Value = Value(YES_OPTION)
val Ok : Result.Value = Value(OK_OPTION)
val Ok : Result.Value = Yes // N.B. Do not use `Value` because id 0 is already used
val No : Result.Value = Value(NO_OPTION)
val Cancel: Result.Value = Value(CANCEL_OPTION)
val Closed: Result.Value = Value(CLOSED_OPTION)
Expand Down
30 changes: 30 additions & 0 deletions src/test/scala/scala/swing/Issue73.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package scala.swing

import org.scalatest.{FlatSpec, Matchers}

class Issue73 extends FlatSpec with Matchers {
"Enumerations" should "not contain duplicate ids" in {
// the initializers of any of these will through an
// assertion error if an enumeration `Value` id is used twice.
Alignment
BorderPanel.Position
Dialog.Message
Dialog.Options
Dialog.Result
FileChooser.Result
FileChooser.SelectionMode
FlowPanel.Alignment
FormattedTextField.FocusLostBehavior
GridBagPanel.Anchor
GridBagPanel.Fill
ListView.IntervalMode
Orientation
ScrollPane.BarPolicy
TabbedPane.Layout
Table.AutoResizeMode
Table.ElementMode
Table.IntervalMode
event.Key
event.Key.Location
}
}

0 comments on commit 5eae857

Please sign in to comment.