⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testcase.as

📁 As3 Crypto is a cryptography library written in Actionscript 3 that provides several common algorith
💻 AS
字号:
/**
 * 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();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -