//  Copyright © 2015 Rob Rix. All rights reserved.

final class DatatypeTests: XCTestCase {
	func testDatatypeWithZeroConstructorsIsUnitType() {
		assert(Datatype(constructors: []).value("A"), ==, .UnitType)
	}

	func testDatatypeWithOneConstructorIsTypeOfConstructedValue() {
		assert(Datatype(constructors: [ ("a", .Argument(.BooleanType, const(.End))) ]).value("A"), ==, .lambda(.BooleanType, const(.Product(.BooleanType, .UnitType))))
	}
}


import Assertions
@testable import Manifold
import Prelude
import XCTest

//  Copyright © 2015 Rob Rix. All rights reserved.

final class DatatypeTests: XCTestCase {
	func testDatatypeWithZeroConstructorsIsUnitType() {
		assert(Datatype(constructors: []).value("A"), ==, .UnitType)
	}
}


import Assertions
@testable import Manifold
import XCTest

--- 
+++ 
@@ -4,9 +4,14 @@
 	func testDatatypeWithZeroConstructorsIsUnitType() {
 		assert(Datatype(constructors: []).value("A"), ==, .UnitType)
 	}
+
+	func testDatatypeWithOneConstructorIsTypeOfConstructedValue() {
+		assert(Datatype(constructors: [ ("a", .Argument(.BooleanType, const(.End))) ]).value("A"), ==, .lambda(.BooleanType, const(.Product(.BooleanType, .UnitType))))
+	}
 }
 
 
 import Assertions
 @testable import Manifold
+import Prelude
 import XCTest
Test the value of single-constructor datatypes.
