提交 9f23d866 编写于 作者: B Brian Cajes

started adding Color unit tests

上级 f47528f1
module( "Color" );
test( "constructor", function(){
var c = new THREE.Color();
ok( c.r, "Red: " + c.r );
ok( c.g, "Green: " + c.g );
ok( c.b, "Blue: " + c.g );
});
test( "copy", function(){
var c = new THREE.Color();
var c2 = new THREE.Color('red');
c.copy(c2);
ok( c.r == 1, "Red c: " + c.r + " Red c2: " + c2.r);
ok( c.g == 0, "Green c: " + c.g + " Green c2: " + c2.g);
ok( c.b == 0, "Blue c: " + c.g + " Blue c2: " + c2.b);
});
test( "setRGB", function(){
var c = new THREE.Color()
c.setRGB(0, 1, 2);
ok( c.r == 0, "Red: " + c.r );
ok( c.g == 1, "Green: " + c.g );
ok( c.b == 1, "Blue: " + c.b );
});
module( "Color" );
test( "constructor", function(){
var c = new Color()
ok(c, "Passed!")
});
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<script src="math/Quaternion.js"></script> <script src="math/Quaternion.js"></script>
<script src="math/Matrix3.js"></script> <script src="math/Matrix3.js"></script>
<script src="math/Matrix4.js"></script> <script src="math/Matrix4.js"></script>
<script src="math/Color.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册