Skip to content

fixes #73 #74

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 1 commit into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
}
}