2009-10-30 06:59:35 +08:00
|
|
|
var s = process.http.createServer(function (req, res) {
|
2009-06-16 14:20:00 +08:00
|
|
|
var body = "exports.A = function() { return 'A';}";
|
|
|
|
res.sendHeader(200, [
|
|
|
|
["Content-Length", body.length],
|
|
|
|
["Content-Type", "text/plain"]
|
|
|
|
]);
|
|
|
|
res.sendBody(body);
|
|
|
|
res.finish();
|
2009-06-21 22:59:11 +08:00
|
|
|
});
|
|
|
|
s.listen(8000);
|
2009-06-16 14:20:00 +08:00
|
|
|
|
2009-10-30 06:59:35 +08:00
|
|
|
process.mixin(require("../common.js"));
|
2009-06-16 14:20:00 +08:00
|
|
|
var a = require("http://localhost:8000/")
|
|
|
|
|
2009-08-27 00:22:00 +08:00
|
|
|
assertInstanceof(a.A, Function);
|
|
|
|
assertEquals("A", a.A());
|
|
|
|
s.close();
|