//  Copyright (c) 2015 Rob Rix. All rights reserved.

import Prelude
import Tesseract
import XCTest

final class ValueTests: XCTestCase {
	func testConstantValueDestructuresWithFunctionOfSameType() {
		assertEqual(Value(constant: 1).constant(), 1)
	}

	func testConstantValueDestructuresToNilWithFunctionOfDifferentType() {
		assertNil(Value(constant: 1).constant() as ()?)
	}

	func testFunctionValueDestructuresToNilConstant() {
		assertNil(Value(function: id).constant() as Any?)
	}
}

//  Copyright (c) 2015 Rob Rix. All rights reserved.

import Prelude
import Tesseract
import XCTest

final class ValueTests: XCTestCase {
	func testConstantValueDestructuresWithFunctionOfSameType() {
		assertEqual(Value(constant: 1).constant(), 1)
	}

	func testConstantValueDestructuresToNilWithFunctionOfDifferentType() {
		assertNil(Value(constant: 1).constant() as ()?)
	}
}

--- 
+++ 
@@ -12,4 +12,8 @@
 	func testConstantValueDestructuresToNilWithFunctionOfDifferentType() {
 		assertNil(Value(constant: 1).constant() as ()?)
 	}
+
+	func testFunctionValueDestructuresToNilConstant() {
+		assertNil(Value(function: id).constant() as Any?)
+	}
 }
Test that function values destructure to nil.
