|
Scala example source code file (NestUI.scala)
The Scala NestUI.scala source code/* NEST (New Scala Test) * Copyright 2007-2011 LAMP/EPFL * @author Philipp Haller */ // $Id$ package scala.tools.partest package nest import java.io.PrintWriter object NestUI { val NONE = 0 val SOME = 1 val MANY = 2 private var _outline = "" private var _success = "" private var _failure = "" private var _warning = "" private var _default = "" def initialize(number: Int) = number match { case MANY => _outline = Console.BOLD + Console.BLACK _success = Console.BOLD + Console.GREEN _failure = Console.BOLD + Console.RED _warning = Console.BOLD + Console.YELLOW _default = Console.RESET case SOME => _outline = Console.BOLD + Console.BLACK _success = Console.RESET _failure = Console.BOLD + Console.BLACK _warning = Console.BOLD + Console.BLACK _default = Console.RESET case _ => } def outline(msg: String) = print(_outline + msg + _default) def outline(msg: String, wr: PrintWriter) = synchronized { wr.print(_outline + msg + _default) } def success(msg: String) = print(_success + msg + _default) def success(msg: String, wr: PrintWriter) = synchronized { wr.print(_success + msg + _default) } def failure(msg: String) = print(_failure + msg + _default) def failure(msg: String, wr: PrintWriter) = synchronized { wr.print(_failure + msg + _default) } def warning(msg: String) = print(_warning + msg + _default) def warning(msg: String, wr: PrintWriter) = synchronized { wr.print(_warning + msg + _default) } def normal(msg: String) = print(_default + msg) def normal(msg: String, wr: PrintWriter) = synchronized { wr.print(_default + msg) } def usage() { println("Usage: NestRunner [<options>] [ Other Scala examples (source code examples)Here is a short list of links related to this Scala NestUI.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.