зеркало из
				https://github.com/iharh/notes.git
				synced 2025-11-03 23:26:09 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			46 строки
		
	
	
		
			982 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			46 строки
		
	
	
		
			982 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
FunSuite
 | 
						|
FlatSpec
 | 
						|
FunSpec
 | 
						|
WordSpec
 | 
						|
FreeSpec
 | 
						|
Spec
 | 
						|
PropSpec
 | 
						|
FeatureSpec
 | 
						|
 | 
						|
 | 
						|
PropSpec
 | 
						|
import org.staclatest._
 | 
						|
import prop._
 | 
						|
import scala.collection.immutable._
 | 
						|
class SetSpec extends PropSpec with TableDrivenPropertyChecks with Matchers {
 | 
						|
    val examples =
 | 
						|
        Table(
 | 
						|
            "set",
 | 
						|
            BitSet.empty,
 | 
						|
            HashSet.empty[Int],
 | 
						|
            TreeSet.empty[Int]
 | 
						|
        )
 | 
						|
    property("an empty Set should have size 0") {
 | 
						|
        forAll(examples) { set =>
 | 
						|
            set.size should be (0)
 | 
						|
        }
 | 
						|
    }
 | 
						|
    property("invoking head on an empty set should produce NoSuchElementException") {
 | 
						|
        forAll(examples) { set =>
 | 
						|
            a [NoSuchElementException] should be thrownBy { set.head }
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
Defining base class
 | 
						|
 | 
						|
trait MovioSpec extends FunSpecLike
 | 
						|
    with ShouldMatchers
 | 
						|
    with OptionValues
 | 
						|
    with EitherValues
 | 
						|
    with BeforeAndAfter      // before/after
 | 
						|
    with BeforeAndAfterEach  //
 | 
						|
    with BeforeAndAfterAll   //
 | 
						|
    with UtcTime
 | 
						|
 |