/js/lib/Socket.IO-node/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TestCase.as
ActionScript | 42 lines | 29 code | 4 blank | 9 comment | 1 complexity | fef1e46d9e0afd35910ab8d2c0174688 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
- /**
- * TestCase
- *
- * Embryonic unit test support class.
- * Copyright (c) 2007 Henri Torgemane
- *
- * See LICENSE.txt for full license information.
- */
- package com.hurlant.crypto.tests
- {
- public class TestCase
- {
- public var harness:ITestHarness;
-
- public function TestCase(h:ITestHarness, title:String) {
- harness = h;
- harness.beginTestCase(title);
- }
-
-
- public function assert(msg:String, value:Boolean):void {
- if (value) {
- // TestHarness.print("+ ",msg);
- return;
- }
- throw new Error("Test Failure:"+msg);
- }
-
- public function runTest(f:Function, title:String):void {
- harness.beginTest(title);
- try {
- f();
- } catch (e:Error) {
- trace("EXCEPTION THROWN: "+e);
- trace(e.getStackTrace());
- harness.failTest(e.toString());
- return;
- }
- harness.passTest();
- }
- }
- }