mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-17 12:10:42 +00:00
A few more parser tests and reorg of tests.
Reviewed by me.
This commit is contained in:
1 parent
b66034ef38
commit
70e4dd16df
16 files changed
+31
-4
No files matched your search
@@ -758,7 +758,7 @@ Preprocessor.prototype.preprocess = function(tokens, /*StringBuffer*/ aStringBuf
|
||||
{
|
||||
if (tuple)
|
||||
{
|
||||
// Ignore :'s the belong to tertiary operators (?:)
|
||||
// Ignore :'s the belong to ternary operators (?:)
|
||||
if (token === TOKEN_QUESTION_MARK)
|
||||
++closures[2];
|
||||
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
|
||||
[object label:argument label2:argument2 label3:argument3 label4:argument4];
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
objj_msgSend(object, "label:label2:label3:label4:", argument, argument2, argument3, argument4);
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
[object message];
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
objj_msgSend(object, "message");
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
[object label:argument];
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
objj_msgSend(object, "label:", argument);
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
[object label:condition ? true : false];
|
||||
[object label:condition ? true: false];
|
||||
[object label:condition?true:false];
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
objj_msgSend(object, "label:", condition ? true : false);
|
||||
objj_msgSend(object, "label:", condition ? true : false);
|
||||
objj_msgSend(object, "label:", condition ? true : false);
|
||||
@@ -3,7 +3,14 @@ var FILE = require("file"),
|
||||
compressor = require("minify/shrinksafe");
|
||||
|
||||
var FILENAMES = [
|
||||
"Class", "ClassWithIvar", "ClassWithIvars"
|
||||
"Class/root-class",
|
||||
"Class/root-class-one-ivar",
|
||||
"Class/root-class-multiple-ivars",
|
||||
|
||||
"Messages/no-parameter",
|
||||
"Messages/one-parameter",
|
||||
"Messages/multiple-parameters",
|
||||
"Messages/ternary-operator-argument"
|
||||
];
|
||||
|
||||
@implementation PreprocessorTest : OJTestCase
|
||||
@@ -22,10 +29,10 @@ var FILENAMES = [
|
||||
|
||||
class_addMethod(self, testSelector, function(self, _cmd)
|
||||
{
|
||||
var filePath = FILE.join(FILE.dirname(module.path), "Sources", filename + ".j"),
|
||||
var filePath = FILE.join(FILE.dirname(module.path), filename + ".j"),
|
||||
unpreprocessed = FILE.read(filePath, { charset:"UTF-8" });
|
||||
preprocessed = ObjectiveJ.preprocess(unpreprocessed).code(),
|
||||
correct = FILE.read(FILE.join(FILE.dirname(module.path), "Sources", filename + ".js"));
|
||||
correct = FILE.read(FILE.join(FILE.dirname(module.path), filename + ".js"));
|
||||
|
||||
preprocessed = compressor.compress(preprocessed, { charset : "UTF-8", useServer : true });
|
||||
correct = compressor.compress(correct, { charset : "UTF-8", useServer : true });
|
||||
|
||||
Reference in new issue
Block a user