Changeset 173 for trunk/tests
- Timestamp:
- 05/27/07 16:59:34 (2 years ago)
- Files:
-
- trunk/tests/base.md (modified) (2 diffs)
- trunk/tests/compiler/compiler.md (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tests/base.md
r170 r173 69 69 currentThread(); 70 70 curry(function(x, y){}, 3)(4); 71 try require("blahblah"); catch(e){}72 require("tests.dummy");71 try import("blahblah"); catch(e){} 72 import("tests.dummy"); 73 73 loadString(""); 74 74 loadString("", "h"); … … 108 108 try s[-392096 .. 0] = "h"; catch(e){} 109 109 110 readf("%d"); 110 { 111 function loadMod(name, ns) 112 { 113 assert(name == "mod"); 114 115 ns.x = "I'm x"; 116 117 ns.foo = function foo() 118 { 119 writefln("foo"); 120 }; 121 122 ns.bar = function bar(x) 123 { 124 return x[0]; 125 }; 126 127 ns.baz = function baz() 128 { 129 writefln(x); 130 }; 131 132 foreach(k, v; ns) 133 if(isFunction(v)) 134 v.environment(ns); 135 } 136 137 setModuleLoader("mod", loadMod); 138 139 import mod : foo, bar; 140 foo(); 141 writefln(bar([5])); 142 mod.baz(); 143 144 writefln(); 145 146 readf("%d"); 147 } trunk/tests/compiler/compiler.md
r172 r173 233 233 try loadString("if([]){}"); catch(e){} 234 234 loadString("yield(1); yield(f()); class A : B { this() { super(); } function f() { super.f(2); x = [super.f()]; }}"); 235 try require("tests.compiler.dupimportlocals"); catch(e){} 236 require("tests.compiler.noimportlocals"); 235 try import("tests.compiler.dupimportlocals"); catch(e){} 236 import("tests.compiler.noimportlocals"); 237 loadString("namespace a : b { function foo(){} bar = 5; baz; } local namespace b {} namespace c{} global namespace d {} "); 238 loadString("x = namespace x{};"); 239 try loadString("namespace a{"); catch(e){} 240 try loadString("namespace a { x; x; }"); catch(e){} 241 try loadString("namespace a { #### }"); catch(e){} 237 242 try loadString(`x = "hello\`); catch(e){}
