mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: Converting the test cases in ToolTest.j to Node
This commit is contained in:
+9
-12
@@ -35,7 +35,7 @@ function cleanup() {
|
||||
- (void)testTools
|
||||
{
|
||||
var status,
|
||||
rootDirectory = ""//FILE.cwd();
|
||||
rootDirectory = process.cwd();
|
||||
|
||||
[self assertNoThrow: function() {
|
||||
childProcess.execSync(["capp", "gen", "ToolsTestApp"].map(utilsFile.enquote).join(" ") + " > /dev/null", {stdio: 'inherit'});
|
||||
@@ -56,40 +56,37 @@ function cleanup() {
|
||||
}];
|
||||
|
||||
status = [self assertThrows: function() {
|
||||
debugger;
|
||||
return childProcess.execSync(["objj", "--xml", "objjErrorTestFile.j"].map(utilsFile.enquote).join(" "), {stdio: 'pipe'});
|
||||
}];
|
||||
[self assert:"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version = \"1.0\"><array><dict><key>line</key><integer>1</integer><key>sourcePath</key><string>" + rootDirectory + "/objjErrorTestFile.j</string><key>message</key><string>\
|
||||
\n@implementation AppController : CPObject{}@end\
|
||||
\n ^\
|
||||
\nERROR line 1 in file:" + rootDirectory + "/objjErrorTestFile.j:1: Can't find superclass CPObject</string></dict></array></plist>\n" equals:status message:"objj failed"];
|
||||
|
||||
process.exit(0);
|
||||
\nERROR line 1 in file:" + rootDirectory + "/objjErrorTestFile.j:1: Can't find superclass CPObject</string></dict></array></plist>\n" equals:status.stdout.toString() message:"objj failed"];
|
||||
status = [self assertNoThrow: function() {
|
||||
childProcess.execSync(["objj", "-x", "objjWarningTestFile.j"].map(utilsFile.enquote).join(" "), {stdio: 'inherit'});
|
||||
return childProcess.execSync(["objj", "-x", "objjWarningTestFile.j"].map(utilsFile.enquote).join(" "), {stdio: 'pipe'});
|
||||
}];
|
||||
[self assert:"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version = \"1.0\"><array><dict><key>line</key><integer>1</integer><key>sourcePath</key><string>" + rootDirectory + "/objjWarningTestFile.j</string><key>message</key><string>\n@import <Foundation/Foundation.j>@implementation AppController : CPObject{CPWindow theWindow;}@end\
|
||||
\n ^\
|
||||
\nWARNING line 1 in file:" + rootDirectory + "/objjWarningTestFile.j:1: Unknown type 'CPWindow' for ivar 'theWindow'</string></dict></array></plist>\n" equals:status message:"objj failed"];
|
||||
\nWARNING line 1 in file:" + rootDirectory + "/objjWarningTestFile.j:1: Unknown type 'CPWindow' for ivar 'theWindow'</string></dict></array></plist>\n" equals:status.toString() message:"objj failed"];
|
||||
|
||||
[self assertNoThrow: function() {
|
||||
childProcess.execSync(["objj", "-m", "ToolsTestApp/AppController.j", "ToolsTestApp/AppController.j"], {stdio: 'inherit'});
|
||||
childProcess.execSync(["objj", "-m", "ToolsTestApp/AppController.j", "ToolsTestApp/AppController.j"].map(utilsFile.enquote).join(" "), {stdio: 'ignore'});
|
||||
}];
|
||||
|
||||
[self assertNoThrow: function() {
|
||||
childProcess.execSync(["objj", "-I", "ToolsTestApp/Frameworks", "ToolsTestApp/AppController.j"], {stdio: 'inherit'});
|
||||
childProcess.execSync(["objj", "-IToolsTestApp/Frameworks", "ToolsTestApp/AppController.j"].map(utilsFile.enquote).join(" "), {stdio: 'ignore'});
|
||||
}];
|
||||
|
||||
[self assertNoThrow: function() {
|
||||
childProcess.execSync(["objj2objcskeleton", "objj2objcskeletonTestFile.j", "."], {stdio: 'inherit'});
|
||||
childProcess.execSync(["objj2objcskeleton", "objj2objcskeletonTestFile.j", "."].map(utilsFile.enquote).join(" "), {stdio: 'ignore'});
|
||||
}];
|
||||
|
||||
var contentHeader = fs.readFileSync("objj2objcskeletonTestFile.h"),
|
||||
var contentHeader = fs.readFileSync("objj2objcskeletonTestFile.h").toString(),
|
||||
expectedHeaderResult = "#import <Cocoa/Cocoa.h>\n#import \"xcc_general_include.h\"\n\n@interface AppController : NSObject\n\n@property (assign) IBOutlet NSSplitView* splitViewA;\n@property (assign) IBOutlet NSSplitView* splitViewB;\n@property (assign) IBOutlet NSSplitView* splitViewC;\n\n@end\n";
|
||||
|
||||
[self assert:contentHeader equals:expectedHeaderResult message:@"Header generated by objj2objcskeleton is wrong"];
|
||||
|
||||
var contentMFile = fs.readFileSync("objj2objcskeletonTestFile.m"),
|
||||
var contentMFile = fs.readFileSync("objj2objcskeletonTestFile.m").toString(),
|
||||
expectedMResult = "#import \"objj2objcskeletonTestFile.h\"\n\n@implementation AppController\n@end\n";
|
||||
|
||||
[self assert:contentMFile equals:expectedMResult message:@"File generated by objj2objcskeleton is wrong"];
|
||||
|
||||
Reference in New Issue
Block a user