From 04d13e6071b5daa0106d80c146048a148d7fad13 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 9 Dec 2011 11:52:56 -0800 Subject: Disabled another presentation compiler test. It foiled me right on the cusp of a successful windows nightly. https://scala-webapps.epfl.ch/jenkins/job/scala-nightly-windows/1170/consoleText --- test/disabled/properties.check | 158 +++++++++++++++++++++ test/disabled/properties/Runner.scala | 3 + test/disabled/properties/src/properties.scala | 54 +++++++ test/files/presentation/properties.check | 158 --------------------- test/files/presentation/properties/Runner.scala | 3 - .../presentation/properties/src/properties.scala | 54 ------- 6 files changed, 215 insertions(+), 215 deletions(-) create mode 100644 test/disabled/properties.check create mode 100644 test/disabled/properties/Runner.scala create mode 100644 test/disabled/properties/src/properties.scala delete mode 100644 test/files/presentation/properties.check delete mode 100644 test/files/presentation/properties/Runner.scala delete mode 100644 test/files/presentation/properties/src/properties.scala diff --git a/test/disabled/properties.check b/test/disabled/properties.check new file mode 100644 index 0000000000..a721d49e3a --- /dev/null +++ b/test/disabled/properties.check @@ -0,0 +1,158 @@ +reload: properties.scala + +askTypeCompletion at properties.scala(29,33) +================================================================================ +[response] aksTypeCompletion at (29,33) +retrieved 50 members +`method !=(x$1: Any)Boolean` +`method !=(x$1: AnyRef)Boolean` +`method ##()Int` +`method +(other: String)String` +`method ->[B](y: B)(properties.Property[String], B)` +`method ==(x$1: Any)Boolean` +`method ==(x$1: AnyRef)Boolean` +`method apply()String` +`method asInstanceOf[T0]=> T0` +`method canEqual(that: Any)Boolean` +`method clone()Object` +`method ensuring(cond: Boolean)properties.Property[String]` +`method ensuring(cond: Boolean, msg: => Any)properties.Property[String]` +`method ensuring(cond: properties.Property[String] => Boolean)properties.Property[String]` +`method ensuring(cond: properties.Property[String] => Boolean, msg: => Any)properties.Property[String]` +`method eq(x$1: AnyRef)Boolean` +`method equals(x$1: Any)Boolean` +`method finalize()Unit` +`method formatted(fmtstr: String)String` +`method get(newGetter: String => String)properties.Property[String]` +`method hashCode()Int` +`method isInstanceOf[T0]=> Boolean` +`method ne(x$1: AnyRef)Boolean` +`method notify()Unit` +`method notifyAll()Unit` +`method productArity=> Int` +`method productElement(n: Int)Any` +`method productIterator=> Iterator[Any]` +`method productPrefix=> String` +`method set(newSetter: String => String)properties.Property[String]` +`method synchronized[T0](x$1: T0)T0` +`method toString()String` +`method update(newValue: String)Unit` +`method wait()Unit` +`method wait(x$1: Long)Unit` +`method wait(x$1: Long, x$2: Int)Unit` +`method x=> properties.Property[String]` +`method →[B](y: B)(properties.Property[String], B)` +`value __leftOfArrowproperties.Property[String]` +`value __resultOfEnsuringproperties.Property[String]` +`value initString` +`value selfAny` +`variable getterString => String` +`variable setterString => String` +`variable valueString` +================================================================================ + +askTypeCompletion at properties.scala(29,67) +================================================================================ +[response] aksTypeCompletion at (29,67) +retrieved 50 members +`method !=(x$1: Any)Boolean` +`method !=(x$1: AnyRef)Boolean` +`method ##()Int` +`method +(other: String)String` +`method ->[B](y: B)(properties.Property[String], B)` +`method ==(x$1: Any)Boolean` +`method ==(x$1: AnyRef)Boolean` +`method apply()String` +`method asInstanceOf[T0]=> T0` +`method canEqual(that: Any)Boolean` +`method clone()Object` +`method ensuring(cond: Boolean)properties.Property[String]` +`method ensuring(cond: Boolean, msg: => Any)properties.Property[String]` +`method ensuring(cond: properties.Property[String] => Boolean)properties.Property[String]` +`method ensuring(cond: properties.Property[String] => Boolean, msg: => Any)properties.Property[String]` +`method eq(x$1: AnyRef)Boolean` +`method equals(x$1: Any)Boolean` +`method finalize()Unit` +`method formatted(fmtstr: String)String` +`method get(newGetter: String => String)properties.Property[String]` +`method hashCode()Int` +`method isInstanceOf[T0]=> Boolean` +`method ne(x$1: AnyRef)Boolean` +`method notify()Unit` +`method notifyAll()Unit` +`method productArity=> Int` +`method productElement(n: Int)Any` +`method productIterator=> Iterator[Any]` +`method productPrefix=> String` +`method set(newSetter: String => String)properties.Property[String]` +`method synchronized[T0](x$1: T0)T0` +`method toString()String` +`method update(newValue: String)Unit` +`method wait()Unit` +`method wait(x$1: Long)Unit` +`method wait(x$1: Long, x$2: Int)Unit` +`method x=> properties.Property[String]` +`method →[B](y: B)(properties.Property[String], B)` +`value __leftOfArrowproperties.Property[String]` +`value __resultOfEnsuringproperties.Property[String]` +`value initString` +`value selfAny` +`variable getterString => String` +`variable setterString => String` +`variable valueString` +================================================================================ + +askTypeCompletion at properties.scala(45,10) +================================================================================ +[response] aksTypeCompletion at (45,10) +retrieved 38 members +`method !=(x$1: Any)Boolean` +`method !=(x$1: AnyRef)Boolean` +`method ##()Int` +`method +(other: String)String` +`method ->[B](y: B)(properties.User, B)` +`method ==(x$1: Any)Boolean` +`method ==(x$1: AnyRef)Boolean` +`method asInstanceOf[T0]=> T0` +`method clone()Object` +`method ensuring(cond: Boolean)properties.User` +`method ensuring(cond: Boolean, msg: => Any)properties.User` +`method ensuring(cond: properties.User => Boolean)properties.User` +`method ensuring(cond: properties.User => Boolean, msg: => Any)properties.User` +`method eq(x$1: AnyRef)Boolean` +`method equals(x$1: Any)Boolean` +`method finalize()Unit` +`method formatted(fmtstr: String)String` +`method hashCode()Int` +`method isInstanceOf[T0]=> Boolean` +`method ne(x$1: AnyRef)Boolean` +`method notify()Unit` +`method notifyAll()Unit` +`method synchronized[T0](x$1: T0)T0` +`method toString()String` +`method wait()Unit` +`method wait(x$1: Long)Unit` +`method wait(x$1: Long, x$2: Int)Unit` +`method x=> properties.User` +`method →[B](y: B)(properties.User, B)` +`value __leftOfArrowproperties.User` +`value __resultOfEnsuringproperties.User` +`value firstnameproperties.Property[String]` +`value lastnameproperties.Property[String]` +`value selfAny` +================================================================================ + +askType at properties.scala(18,28) +================================================================================ +[response] askTypeAt at (18,28) +def update(newValue: T): Unit = Property.this.value_=(Property.this.setter.apply(newValue)) +================================================================================ + +askType at properties.scala(21,31) +================================================================================ +[response] askTypeAt at (21,31) +def get(newGetter: T => T): properties.Property[T] = { + Property.this.getter_=(newGetter); + this +} +================================================================================ diff --git a/test/disabled/properties/Runner.scala b/test/disabled/properties/Runner.scala new file mode 100644 index 0000000000..1ef3cf9025 --- /dev/null +++ b/test/disabled/properties/Runner.scala @@ -0,0 +1,3 @@ +import scala.tools.nsc.interactive.tests._ + +object Test extends InteractiveTest \ No newline at end of file diff --git a/test/disabled/properties/src/properties.scala b/test/disabled/properties/src/properties.scala new file mode 100644 index 0000000000..35b6a92221 --- /dev/null +++ b/test/disabled/properties/src/properties.scala @@ -0,0 +1,54 @@ +/** Illustrate the use of custom 'apply/update' methods. */ +object properties { + + /** A mutable property whose getter and setter may be customized. */ + case class Property[T](init: T) { + private var value: T = init + + /** The getter function, defaults to identity. */ + private var setter: T => T = identity[T] + + /** The setter function, defaults to identity. */ + private var getter: T => T = identity[T] + + /** Retrive the value held in this property. */ + def apply(): T = getter(value) + + /** Update the value held in this property, through the setter. */ + def update(newValue: T) /*?*/ = value = setter(newValue) + + /** Change the getter. */ + def get(newGetter: T => T) /*?*/ = { getter = newGetter; this } + + /** Change the setter */ + def set(newSetter: T => T) = { setter = newSetter; this } + } + + class User { + // Create a property with custom getter and setter + val firstname = Property("")./*!*/get { v => v.toUpperCase() }./*!*/set { v => "Mr. " + v } + val lastname = Property("") + + /** Scala provides syntactic sugar for calling 'apply'. Simply + * adding a list of arguments between parenthesis (in this case, + * an empty list) is translated to a call to 'apply' with those + * arguments. + */ + override def toString() = firstname() + " " + lastname() + } + + def main(args: Array[String]) { + val user1 = new User + + // Syntactic sugar for 'update': an assignment is translated to a + // call to method 'update' + user1./*!*/firstname() = "Robert" + + val user2 = new User + user2.firstname() = "bob" + user2.lastname() = "KUZ" + + println("user1: " + user1) + println("user2: " + user2) + } +} \ No newline at end of file diff --git a/test/files/presentation/properties.check b/test/files/presentation/properties.check deleted file mode 100644 index a721d49e3a..0000000000 --- a/test/files/presentation/properties.check +++ /dev/null @@ -1,158 +0,0 @@ -reload: properties.scala - -askTypeCompletion at properties.scala(29,33) -================================================================================ -[response] aksTypeCompletion at (29,33) -retrieved 50 members -`method !=(x$1: Any)Boolean` -`method !=(x$1: AnyRef)Boolean` -`method ##()Int` -`method +(other: String)String` -`method ->[B](y: B)(properties.Property[String], B)` -`method ==(x$1: Any)Boolean` -`method ==(x$1: AnyRef)Boolean` -`method apply()String` -`method asInstanceOf[T0]=> T0` -`method canEqual(that: Any)Boolean` -`method clone()Object` -`method ensuring(cond: Boolean)properties.Property[String]` -`method ensuring(cond: Boolean, msg: => Any)properties.Property[String]` -`method ensuring(cond: properties.Property[String] => Boolean)properties.Property[String]` -`method ensuring(cond: properties.Property[String] => Boolean, msg: => Any)properties.Property[String]` -`method eq(x$1: AnyRef)Boolean` -`method equals(x$1: Any)Boolean` -`method finalize()Unit` -`method formatted(fmtstr: String)String` -`method get(newGetter: String => String)properties.Property[String]` -`method hashCode()Int` -`method isInstanceOf[T0]=> Boolean` -`method ne(x$1: AnyRef)Boolean` -`method notify()Unit` -`method notifyAll()Unit` -`method productArity=> Int` -`method productElement(n: Int)Any` -`method productIterator=> Iterator[Any]` -`method productPrefix=> String` -`method set(newSetter: String => String)properties.Property[String]` -`method synchronized[T0](x$1: T0)T0` -`method toString()String` -`method update(newValue: String)Unit` -`method wait()Unit` -`method wait(x$1: Long)Unit` -`method wait(x$1: Long, x$2: Int)Unit` -`method x=> properties.Property[String]` -`method →[B](y: B)(properties.Property[String], B)` -`value __leftOfArrowproperties.Property[String]` -`value __resultOfEnsuringproperties.Property[String]` -`value initString` -`value selfAny` -`variable getterString => String` -`variable setterString => String` -`variable valueString` -================================================================================ - -askTypeCompletion at properties.scala(29,67) -================================================================================ -[response] aksTypeCompletion at (29,67) -retrieved 50 members -`method !=(x$1: Any)Boolean` -`method !=(x$1: AnyRef)Boolean` -`method ##()Int` -`method +(other: String)String` -`method ->[B](y: B)(properties.Property[String], B)` -`method ==(x$1: Any)Boolean` -`method ==(x$1: AnyRef)Boolean` -`method apply()String` -`method asInstanceOf[T0]=> T0` -`method canEqual(that: Any)Boolean` -`method clone()Object` -`method ensuring(cond: Boolean)properties.Property[String]` -`method ensuring(cond: Boolean, msg: => Any)properties.Property[String]` -`method ensuring(cond: properties.Property[String] => Boolean)properties.Property[String]` -`method ensuring(cond: properties.Property[String] => Boolean, msg: => Any)properties.Property[String]` -`method eq(x$1: AnyRef)Boolean` -`method equals(x$1: Any)Boolean` -`method finalize()Unit` -`method formatted(fmtstr: String)String` -`method get(newGetter: String => String)properties.Property[String]` -`method hashCode()Int` -`method isInstanceOf[T0]=> Boolean` -`method ne(x$1: AnyRef)Boolean` -`method notify()Unit` -`method notifyAll()Unit` -`method productArity=> Int` -`method productElement(n: Int)Any` -`method productIterator=> Iterator[Any]` -`method productPrefix=> String` -`method set(newSetter: String => String)properties.Property[String]` -`method synchronized[T0](x$1: T0)T0` -`method toString()String` -`method update(newValue: String)Unit` -`method wait()Unit` -`method wait(x$1: Long)Unit` -`method wait(x$1: Long, x$2: Int)Unit` -`method x=> properties.Property[String]` -`method →[B](y: B)(properties.Property[String], B)` -`value __leftOfArrowproperties.Property[String]` -`value __resultOfEnsuringproperties.Property[String]` -`value initString` -`value selfAny` -`variable getterString => String` -`variable setterString => String` -`variable valueString` -================================================================================ - -askTypeCompletion at properties.scala(45,10) -================================================================================ -[response] aksTypeCompletion at (45,10) -retrieved 38 members -`method !=(x$1: Any)Boolean` -`method !=(x$1: AnyRef)Boolean` -`method ##()Int` -`method +(other: String)String` -`method ->[B](y: B)(properties.User, B)` -`method ==(x$1: Any)Boolean` -`method ==(x$1: AnyRef)Boolean` -`method asInstanceOf[T0]=> T0` -`method clone()Object` -`method ensuring(cond: Boolean)properties.User` -`method ensuring(cond: Boolean, msg: => Any)properties.User` -`method ensuring(cond: properties.User => Boolean)properties.User` -`method ensuring(cond: properties.User => Boolean, msg: => Any)properties.User` -`method eq(x$1: AnyRef)Boolean` -`method equals(x$1: Any)Boolean` -`method finalize()Unit` -`method formatted(fmtstr: String)String` -`method hashCode()Int` -`method isInstanceOf[T0]=> Boolean` -`method ne(x$1: AnyRef)Boolean` -`method notify()Unit` -`method notifyAll()Unit` -`method synchronized[T0](x$1: T0)T0` -`method toString()String` -`method wait()Unit` -`method wait(x$1: Long)Unit` -`method wait(x$1: Long, x$2: Int)Unit` -`method x=> properties.User` -`method →[B](y: B)(properties.User, B)` -`value __leftOfArrowproperties.User` -`value __resultOfEnsuringproperties.User` -`value firstnameproperties.Property[String]` -`value lastnameproperties.Property[String]` -`value selfAny` -================================================================================ - -askType at properties.scala(18,28) -================================================================================ -[response] askTypeAt at (18,28) -def update(newValue: T): Unit = Property.this.value_=(Property.this.setter.apply(newValue)) -================================================================================ - -askType at properties.scala(21,31) -================================================================================ -[response] askTypeAt at (21,31) -def get(newGetter: T => T): properties.Property[T] = { - Property.this.getter_=(newGetter); - this -} -================================================================================ diff --git a/test/files/presentation/properties/Runner.scala b/test/files/presentation/properties/Runner.scala deleted file mode 100644 index 1ef3cf9025..0000000000 --- a/test/files/presentation/properties/Runner.scala +++ /dev/null @@ -1,3 +0,0 @@ -import scala.tools.nsc.interactive.tests._ - -object Test extends InteractiveTest \ No newline at end of file diff --git a/test/files/presentation/properties/src/properties.scala b/test/files/presentation/properties/src/properties.scala deleted file mode 100644 index 35b6a92221..0000000000 --- a/test/files/presentation/properties/src/properties.scala +++ /dev/null @@ -1,54 +0,0 @@ -/** Illustrate the use of custom 'apply/update' methods. */ -object properties { - - /** A mutable property whose getter and setter may be customized. */ - case class Property[T](init: T) { - private var value: T = init - - /** The getter function, defaults to identity. */ - private var setter: T => T = identity[T] - - /** The setter function, defaults to identity. */ - private var getter: T => T = identity[T] - - /** Retrive the value held in this property. */ - def apply(): T = getter(value) - - /** Update the value held in this property, through the setter. */ - def update(newValue: T) /*?*/ = value = setter(newValue) - - /** Change the getter. */ - def get(newGetter: T => T) /*?*/ = { getter = newGetter; this } - - /** Change the setter */ - def set(newSetter: T => T) = { setter = newSetter; this } - } - - class User { - // Create a property with custom getter and setter - val firstname = Property("")./*!*/get { v => v.toUpperCase() }./*!*/set { v => "Mr. " + v } - val lastname = Property("") - - /** Scala provides syntactic sugar for calling 'apply'. Simply - * adding a list of arguments between parenthesis (in this case, - * an empty list) is translated to a call to 'apply' with those - * arguments. - */ - override def toString() = firstname() + " " + lastname() - } - - def main(args: Array[String]) { - val user1 = new User - - // Syntactic sugar for 'update': an assignment is translated to a - // call to method 'update' - user1./*!*/firstname() = "Robert" - - val user2 = new User - user2.firstname() = "bob" - user2.lastname() = "KUZ" - - println("user1: " + user1) - println("user2: " + user2) - } -} \ No newline at end of file -- cgit v1.2.3