|
@@ -13,11 +13,6 @@ $core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "testedClass",
|
|
|
protocol: "fixture",
|
|
|
-fn: function (){
|
|
|
-var self=this,$self=this;
|
|
|
-return $globals.Silk;
|
|
|
-
|
|
|
-},
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
args: [],
|
|
|
source: "testedClass\x0a\x09^ Silk",
|
|
@@ -25,7 +20,11 @@ referencedClasses: ["Silk"],
|
|
|
//>>excludeEnd("ide");
|
|
|
pragmas: [],
|
|
|
messageSends: []
|
|
|
-}),
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
+var self=this,$self=this;
|
|
|
+return $globals.Silk;
|
|
|
+
|
|
|
+}; }),
|
|
|
$globals.SilkInheritedTest);
|
|
|
|
|
|
|
|
@@ -35,61 +34,67 @@ $core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "assertBodyEndsWith:",
|
|
|
protocol: "fixture",
|
|
|
-fn: function (aString){
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: ["aString"],
|
|
|
+source: "assertBodyEndsWith: aString\x0a\x09| sanitizedBody sanitizedAssertion |\x0a\x09sanitizedBody := document body innerHTML replace: '\x5cs*' with: ''.\x0a\x09sanitizedAssertion := aString replace: '\x5cs*' with: ''.\x0a\x09self assert: sanitizedBody size >= sanitizedAssertion size.\x0a\x09self\x0a\x09\x09assert: (sanitizedBody last: sanitizedAssertion size)\x0a\x09\x09equals: sanitizedAssertion",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["replace:with:", "innerHTML", "body", "assert:", ">=", "size", "assert:equals:", "last:"]
|
|
|
+}, function ($methodClass){ return function (aString){
|
|
|
var self=this,$self=this;
|
|
|
var sanitizedBody,sanitizedAssertion;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $2,$3,$1;
|
|
|
-sanitizedBody=$recv($recv($recv(document)._body())._innerHTML())._replace_with_("\x5cs*","");
|
|
|
+sanitizedBody=[$recv($recv($recv(document)._body())._innerHTML())._replace_with_("\x5cs*","")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["replace:with:"]=1;
|
|
|
+,$ctx1.sendIdx["replace:with:"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
+][0];
|
|
|
sanitizedAssertion=$recv(aString)._replace_with_("\x5cs*","");
|
|
|
-$2=$recv(sanitizedBody)._size();
|
|
|
+$self._assert_($recv([$recv(sanitizedBody)._size()
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["size"]=1;
|
|
|
+,$ctx1.sendIdx["size"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$3=$recv(sanitizedAssertion)._size();
|
|
|
+][0]).__gt_eq([$recv(sanitizedAssertion)._size()
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["size"]=2;
|
|
|
+,$ctx1.sendIdx["size"]=2
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$1=$recv($2).__gt_eq($3);
|
|
|
-$self._assert_($1);
|
|
|
+][0]));
|
|
|
$self._assert_equals_($recv(sanitizedBody)._last_($recv(sanitizedAssertion)._size()),sanitizedAssertion);
|
|
|
return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"assertBodyEndsWith:",{aString:aString,sanitizedBody:sanitizedBody,sanitizedAssertion:sanitizedAssertion})});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: ["aString"],
|
|
|
-source: "assertBodyEndsWith: aString\x0a\x09| sanitizedBody sanitizedAssertion |\x0a\x09sanitizedBody := document body innerHTML replace: '\x5cs*' with: ''.\x0a\x09sanitizedAssertion := aString replace: '\x5cs*' with: ''.\x0a\x09self assert: sanitizedBody size >= sanitizedAssertion size.\x0a\x09self\x0a\x09\x09assert: (sanitizedBody last: sanitizedAssertion size)\x0a\x09\x09equals: sanitizedAssertion",
|
|
|
-referencedClasses: [],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["replace:with:", "innerHTML", "body", "assert:", ">=", "size", "assert:equals:", "last:"]
|
|
|
-}),
|
|
|
+}; }),
|
|
|
$globals.SilkTest);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "assertBodyEndsWithOneOf:",
|
|
|
protocol: "fixture",
|
|
|
-fn: function (aStringArray){
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: ["aStringArray"],
|
|
|
+source: "assertBodyEndsWithOneOf: aStringArray\x0a\x09| sanitizedBody err |\x0a\x09sanitizedBody := document body innerHTML replace: '\x5cs*' with: ''.\x0a\x09aStringArray do: [ :aString |\x0a\x09\x09| sanitizedAssertion |\x0a\x09\x09sanitizedAssertion := aString replace: '\x5cs*' with: ''.\x0a\x09\x09[ self\x0a\x09\x09\x09assert: sanitizedBody size >= sanitizedAssertion size;\x0a\x09\x09\x09assert: (sanitizedBody last: sanitizedAssertion size)\x0a\x09\x09\x09equals: sanitizedAssertion. ^ self ] on: Error do: [ :e | err := e ]].\x0a\x09err ifNotNil: [ err signal ]",
|
|
|
+referencedClasses: ["Error"],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["replace:with:", "innerHTML", "body", "do:", "on:do:", "assert:", ">=", "size", "assert:equals:", "last:", "ifNotNil:", "signal"]
|
|
|
+}, function ($methodClass){ return function (aStringArray){
|
|
|
var self=this,$self=this;
|
|
|
var sanitizedBody,err;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $2,$3,$1,$4,$receiver;
|
|
|
+var $1;
|
|
|
var $early={};
|
|
|
try {
|
|
|
-sanitizedBody=$recv($recv($recv(document)._body())._innerHTML())._replace_with_("\x5cs*","");
|
|
|
+sanitizedBody=[$recv($recv($recv(document)._body())._innerHTML())._replace_with_("\x5cs*","")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["replace:with:"]=1;
|
|
|
+,$ctx1.sendIdx["replace:with:"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
+][0];
|
|
|
$recv(aStringArray)._do_((function(aString){
|
|
|
var sanitizedAssertion;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -100,16 +105,15 @@ return $recv((function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx3) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$2=$recv(sanitizedBody)._size();
|
|
|
+$self._assert_($recv([$recv(sanitizedBody)._size()
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx3.sendIdx["size"]=1;
|
|
|
+,$ctx3.sendIdx["size"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$3=$recv(sanitizedAssertion)._size();
|
|
|
+][0]).__gt_eq([$recv(sanitizedAssertion)._size()
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx3.sendIdx["size"]=2;
|
|
|
+,$ctx3.sendIdx["size"]=2
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$1=$recv($2).__gt_eq($3);
|
|
|
-$self._assert_($1);
|
|
|
+][0]));
|
|
|
$self._assert_equals_($recv(sanitizedBody)._last_($recv(sanitizedAssertion)._size()),sanitizedAssertion);
|
|
|
throw $early=[self];
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -124,9 +128,9 @@ return err;
|
|
|
}, function($ctx2) {$ctx2.fillBlock({aString:aString,sanitizedAssertion:sanitizedAssertion},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}));
|
|
|
-$4=err;
|
|
|
-if(($receiver = $4) == null || $receiver.a$nil){
|
|
|
-$4;
|
|
|
+$1=err;
|
|
|
+if($1 == null || $1.a$nil){
|
|
|
+$1;
|
|
|
} else {
|
|
|
$recv(err)._signal();
|
|
|
}
|
|
@@ -136,22 +140,21 @@ catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"assertBodyEndsWithOneOf:",{aStringArray:aStringArray,sanitizedBody:sanitizedBody,err:err})});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: ["aStringArray"],
|
|
|
-source: "assertBodyEndsWithOneOf: aStringArray\x0a\x09| sanitizedBody err |\x0a\x09sanitizedBody := document body innerHTML replace: '\x5cs*' with: ''.\x0a\x09aStringArray do: [ :aString |\x0a\x09\x09| sanitizedAssertion |\x0a\x09\x09sanitizedAssertion := aString replace: '\x5cs*' with: ''.\x0a\x09\x09[ self\x0a\x09\x09\x09assert: sanitizedBody size >= sanitizedAssertion size;\x0a\x09\x09\x09assert: (sanitizedBody last: sanitizedAssertion size)\x0a\x09\x09\x09equals: sanitizedAssertion. ^ self ] on: Error do: [ :e | err := e ]].\x0a\x09err ifNotNil: [ err signal ]",
|
|
|
-referencedClasses: ["Error"],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["replace:with:", "innerHTML", "body", "do:", "on:do:", "assert:", ">=", "size", "assert:equals:", "last:", "ifNotNil:", "signal"]
|
|
|
-}),
|
|
|
+}; }),
|
|
|
$globals.SilkTest);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "setUp",
|
|
|
protocol: "fixture",
|
|
|
-fn: function (){
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: [],
|
|
|
+source: "setUp\x0a\x09fixtureDiv := document createElement: 'div'.\x0a\x09document body appendChild: fixtureDiv.\x0a\x09fixtureDiv setAttribute: 'id' to: 'fixture'.\x0a\x09fixtureDiv innerHTML: 'sentinel'",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["createElement:", "appendChild:", "body", "setAttribute:to:", "innerHTML:"]
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
@@ -164,55 +167,52 @@ return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"setUp",{})});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: [],
|
|
|
-source: "setUp\x0a\x09fixtureDiv := document createElement: 'div'.\x0a\x09document body appendChild: fixtureDiv.\x0a\x09fixtureDiv setAttribute: 'id' to: 'fixture'.\x0a\x09fixtureDiv innerHTML: 'sentinel'",
|
|
|
-referencedClasses: [],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["createElement:", "appendChild:", "body", "setAttribute:to:", "innerHTML:"]
|
|
|
-}),
|
|
|
+}; }),
|
|
|
$globals.SilkTest);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "tearDown",
|
|
|
protocol: "fixture",
|
|
|
-fn: function (){
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: [],
|
|
|
+source: "tearDown\x0a\x09| lastChild |\x0a\x09lastChild := document body lastChild.\x0a\x09self assert: lastChild equals: fixtureDiv.\x0a\x09document body removeChild: lastChild",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["lastChild", "body", "assert:equals:", "removeChild:"]
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
var self=this,$self=this;
|
|
|
var lastChild;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1;
|
|
|
-$1=$recv(document)._body();
|
|
|
+lastChild=$recv([$recv(document)._body()
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["body"]=1;
|
|
|
+,$ctx1.sendIdx["body"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-lastChild=$recv($1)._lastChild();
|
|
|
+][0])._lastChild();
|
|
|
$self._assert_equals_(lastChild,$self.fixtureDiv);
|
|
|
$recv($recv(document)._body())._removeChild_(lastChild);
|
|
|
return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"tearDown",{lastChild:lastChild})});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: [],
|
|
|
-source: "tearDown\x0a\x09| lastChild |\x0a\x09lastChild := document body lastChild.\x0a\x09self assert: lastChild equals: fixtureDiv.\x0a\x09document body removeChild: lastChild",
|
|
|
-referencedClasses: [],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["lastChild", "body", "assert:equals:", "removeChild:"]
|
|
|
-}),
|
|
|
+}; }),
|
|
|
$globals.SilkTest);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "testInsertTable",
|
|
|
protocol: "testing",
|
|
|
-fn: function (){
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: [],
|
|
|
+source: "testInsertTable\x0a\x0a\x09| d tbl |\x0a\x0a\x09d := 'html body div#fixture' asSilk.\x0a\x0a\x09tbl := d TABLE.\x0a\x0a\x09tbl TR\x0a\x09\x09TD: 'A';\x0a\x09\x09TD: 'B';\x0a\x09\x09TD: 'C'.\x0a\x09\x0a\x09tbl TR\x0a\x09\x09TD: 'D';\x0a\x09\x09TD: 'E';\x0a\x09\x09TD: 'F'.\x0a\x09\x0a\x09self assertBodyEndsWith: '>sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>'",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["asSilk", "TABLE", "TD:", "TR", "assertBodyEndsWith:"]
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
var self=this,$self=this;
|
|
|
var d,tbl;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -221,163 +221,166 @@ return $core.withContext(function($ctx1) {
|
|
|
var $1,$2;
|
|
|
d="html body div#fixture"._asSilk();
|
|
|
tbl=$recv(d)._TABLE();
|
|
|
-$1=$recv(tbl)._TR();
|
|
|
+$1=[$recv(tbl)._TR()
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TR"]=1;
|
|
|
+,$ctx1.sendIdx["TR"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$recv($1)._TD_("A");
|
|
|
+][0];
|
|
|
+[$recv($1)._TD_("A")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=1;
|
|
|
+,$ctx1.sendIdx["TD:"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$recv($1)._TD_("B");
|
|
|
+][0];
|
|
|
+[$recv($1)._TD_("B")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=2;
|
|
|
+,$ctx1.sendIdx["TD:"]=2
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$recv($1)._TD_("C");
|
|
|
+][0];
|
|
|
+[$recv($1)._TD_("C")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=3;
|
|
|
+,$ctx1.sendIdx["TD:"]=3
|
|
|
//>>excludeEnd("ctx");
|
|
|
+][0];
|
|
|
$2=$recv(tbl)._TR();
|
|
|
-$recv($2)._TD_("D");
|
|
|
+[$recv($2)._TD_("D")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=4;
|
|
|
+,$ctx1.sendIdx["TD:"]=4
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$recv($2)._TD_("E");
|
|
|
+][0];
|
|
|
+[$recv($2)._TD_("E")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=5;
|
|
|
+,$ctx1.sendIdx["TD:"]=5
|
|
|
//>>excludeEnd("ctx");
|
|
|
+][0];
|
|
|
$recv($2)._TD_("F");
|
|
|
$self._assertBodyEndsWith_(">sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>");
|
|
|
return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"testInsertTable",{d:d,tbl:tbl})});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: [],
|
|
|
-source: "testInsertTable\x0a\x0a\x09| d tbl |\x0a\x0a\x09d := 'html body div#fixture' asSilk.\x0a\x0a\x09tbl := d TABLE.\x0a\x0a\x09tbl TR\x0a\x09\x09TD: 'A';\x0a\x09\x09TD: 'B';\x0a\x09\x09TD: 'C'.\x0a\x09\x0a\x09tbl TR\x0a\x09\x09TD: 'D';\x0a\x09\x09TD: 'E';\x0a\x09\x09TD: 'F'.\x0a\x09\x0a\x09self assertBodyEndsWith: '>sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>'",
|
|
|
-referencedClasses: [],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["asSilk", "TABLE", "TD:", "TR", "assertBodyEndsWith:"]
|
|
|
-}),
|
|
|
+}; }),
|
|
|
$globals.SilkTest);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "testInsertTable2",
|
|
|
protocol: "testing",
|
|
|
-fn: function (){
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: [],
|
|
|
+source: "testInsertTable2\x0a\x0a\x09| d tbl |\x0a\x0a\x09d := 'html body div#fixture' asSilk.\x0a\x0a\x09tbl := d TABLE.\x0a\x0a\x09tbl TR: {\x0a\x09\x09Silk TD: 'A'.\x0a\x09\x09Silk TD: 'B'.\x0a\x09\x09Silk TD: 'C'};\x0a\x09\x09TR: {\x0a\x09\x09Silk TD: 'D'.\x0a\x09\x09Silk TD: 'E'.\x0a\x09\x09Silk TD: 'F'}.\x0a\x09\x0a\x09self assertBodyEndsWith: '>sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>'",
|
|
|
+referencedClasses: ["Silk"],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["asSilk", "TABLE", "TR:", "TD:", "assertBodyEndsWith:"]
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
var self=this,$self=this;
|
|
|
var d,tbl;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1,$3,$4,$5,$2,$7,$8,$6;
|
|
|
+var $1;
|
|
|
d="html body div#fixture"._asSilk();
|
|
|
tbl=$recv(d)._TABLE();
|
|
|
$1=tbl;
|
|
|
-$3=$recv($globals.Silk)._TD_("A");
|
|
|
+[$recv($1)._TR_([[$recv($globals.Silk)._TD_("A")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=1;
|
|
|
+,$ctx1.sendIdx["TD:"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$4=$recv($globals.Silk)._TD_("B");
|
|
|
+][0],[$recv($globals.Silk)._TD_("B")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=2;
|
|
|
+,$ctx1.sendIdx["TD:"]=2
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$5=$recv($globals.Silk)._TD_("C");
|
|
|
+][0],[$recv($globals.Silk)._TD_("C")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=3;
|
|
|
+,$ctx1.sendIdx["TD:"]=3
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$2=[$3,$4,$5];
|
|
|
-$recv($1)._TR_($2);
|
|
|
+][0]])
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TR:"]=1;
|
|
|
+,$ctx1.sendIdx["TR:"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$7=$recv($globals.Silk)._TD_("D");
|
|
|
+][0];
|
|
|
+$recv($1)._TR_([[$recv($globals.Silk)._TD_("D")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=4;
|
|
|
+,$ctx1.sendIdx["TD:"]=4
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$8=$recv($globals.Silk)._TD_("E");
|
|
|
+][0],[$recv($globals.Silk)._TD_("E")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["TD:"]=5;
|
|
|
+,$ctx1.sendIdx["TD:"]=5
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$6=[$7,$8,$recv($globals.Silk)._TD_("F")];
|
|
|
-$recv($1)._TR_($6);
|
|
|
+][0],$recv($globals.Silk)._TD_("F")]);
|
|
|
$self._assertBodyEndsWith_(">sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>");
|
|
|
return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"testInsertTable2",{d:d,tbl:tbl})});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: [],
|
|
|
-source: "testInsertTable2\x0a\x0a\x09| d tbl |\x0a\x0a\x09d := 'html body div#fixture' asSilk.\x0a\x0a\x09tbl := d TABLE.\x0a\x0a\x09tbl TR: {\x0a\x09\x09Silk TD: 'A'.\x0a\x09\x09Silk TD: 'B'.\x0a\x09\x09Silk TD: 'C'};\x0a\x09\x09TR: {\x0a\x09\x09Silk TD: 'D'.\x0a\x09\x09Silk TD: 'E'.\x0a\x09\x09Silk TD: 'F'}.\x0a\x09\x0a\x09self assertBodyEndsWith: '>sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>'",
|
|
|
-referencedClasses: ["Silk"],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["asSilk", "TABLE", "TR:", "TD:", "assertBodyEndsWith:"]
|
|
|
-}),
|
|
|
+}; }),
|
|
|
$globals.SilkTest);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "testNestedDIVsWithAttributes",
|
|
|
protocol: "testing",
|
|
|
-fn: function (){
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: [],
|
|
|
+source: "testNestedDIVsWithAttributes\x0a \x22demonstrates how DIVs are nested and given attributes\x22\x0a\x09| s |\x0a\x0a\x09s := '#fixture' asSilk.\x0a\x09\x0a\x09s := s DIV << ('id' -> 'container') << ('class' -> 'mySilkContainerClass').\x0a\x09s DIV << ('id' -> 'contentarea') << 'here comes the content'.\x0a\x09s := s DIV << ('id' -> 'toolbar') << ('class' -> 'myToolbarClass').\x0a\x09(s BUTTON: 'do something') on: 'click' bind: [Transcript show: 'button pressed'].\x0a\x09\x0a\x09self assertBodyEndsWithOneOf: #(\x0a\x09\x09'>sentinel<div class=\x22mySilkContainerClass\x22 id=\x22container\x22><div id=\x22contentarea\x22>here comes the content</div><div class=\x22myToolbarClass\x22 id=\x22toolbar\x22><button>do something</button></div></div></div>'\x0a\x09\x09'>sentinel<div id=\x22container\x22 class=\x22mySilkContainerClass\x22><div id=\x22contentarea\x22>here comes the content</div><div id=\x22toolbar\x22 class=\x22myToolbarClass\x22><button>do something</button></div></div></div>'\x0a\x09)",
|
|
|
+referencedClasses: ["Transcript"],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["asSilk", "<<", "DIV", "->", "on:bind:", "BUTTON:", "show:", "assertBodyEndsWithOneOf:"]
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
var self=this,$self=this;
|
|
|
var s;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $2,$3,$1,$4,$6,$7,$5,$9,$10,$8;
|
|
|
s="#fixture"._asSilk();
|
|
|
-$2=$recv(s)._DIV();
|
|
|
+s=[$recv([$recv([$recv(s)._DIV()
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["DIV"]=1;
|
|
|
+,$ctx1.sendIdx["DIV"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$3="id".__minus_gt("container");
|
|
|
+][0]).__lt_lt(["id".__minus_gt("container")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["->"]=1;
|
|
|
+,$ctx1.sendIdx["->"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$1=$recv($2).__lt_lt($3);
|
|
|
+][0])
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["<<"]=2;
|
|
|
+,$ctx1.sendIdx["<<"]=2
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$4="class".__minus_gt("mySilkContainerClass");
|
|
|
+][0]).__lt_lt(["class".__minus_gt("mySilkContainerClass")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["->"]=2;
|
|
|
+,$ctx1.sendIdx["->"]=2
|
|
|
//>>excludeEnd("ctx");
|
|
|
-s=$recv($1).__lt_lt($4);
|
|
|
+][0])
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["<<"]=1;
|
|
|
+,$ctx1.sendIdx["<<"]=1
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$6=$recv(s)._DIV();
|
|
|
+][0];
|
|
|
+[$recv([$recv([$recv(s)._DIV()
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["DIV"]=2;
|
|
|
+,$ctx1.sendIdx["DIV"]=2
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$7="id".__minus_gt("contentarea");
|
|
|
+][0]).__lt_lt(["id".__minus_gt("contentarea")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["->"]=3;
|
|
|
+,$ctx1.sendIdx["->"]=3
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$5=$recv($6).__lt_lt($7);
|
|
|
+][0])
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["<<"]=4;
|
|
|
+,$ctx1.sendIdx["<<"]=4
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$recv($5).__lt_lt("here comes the content");
|
|
|
+][0]).__lt_lt("here comes the content")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["<<"]=3;
|
|
|
+,$ctx1.sendIdx["<<"]=3
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$9=$recv(s)._DIV();
|
|
|
-$10="id".__minus_gt("toolbar");
|
|
|
+][0];
|
|
|
+s=[$recv($recv($recv(s)._DIV()).__lt_lt(["id".__minus_gt("toolbar")
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["->"]=4;
|
|
|
+,$ctx1.sendIdx["->"]=4
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$8=$recv($9).__lt_lt($10);
|
|
|
-s=$recv($8).__lt_lt("class".__minus_gt("myToolbarClass"));
|
|
|
+][0])).__lt_lt("class".__minus_gt("myToolbarClass"))
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["<<"]=5;
|
|
|
+,$ctx1.sendIdx["<<"]=5
|
|
|
//>>excludeEnd("ctx");
|
|
|
+][0];
|
|
|
$recv($recv(s)._BUTTON_("do something"))._on_bind_("click",(function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
@@ -392,22 +395,21 @@ return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"testNestedDIVsWithAttributes",{s:s})});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: [],
|
|
|
-source: "testNestedDIVsWithAttributes\x0a \x22demonstrates how DIVs are nested and given attributes\x22\x0a\x09| s |\x0a\x0a\x09s := '#fixture' asSilk.\x0a\x09\x0a\x09s := s DIV << ('id' -> 'container') << ('class' -> 'mySilkContainerClass').\x0a\x09s DIV << ('id' -> 'contentarea') << 'here comes the content'.\x0a\x09s := s DIV << ('id' -> 'toolbar') << ('class' -> 'myToolbarClass').\x0a\x09(s BUTTON: 'do something') on: 'click' bind: [Transcript show: 'button pressed'].\x0a\x09\x0a\x09self assertBodyEndsWithOneOf: #(\x0a\x09\x09'>sentinel<div class=\x22mySilkContainerClass\x22 id=\x22container\x22><div id=\x22contentarea\x22>here comes the content</div><div class=\x22myToolbarClass\x22 id=\x22toolbar\x22><button>do something</button></div></div></div>'\x0a\x09\x09'>sentinel<div id=\x22container\x22 class=\x22mySilkContainerClass\x22><div id=\x22contentarea\x22>here comes the content</div><div id=\x22toolbar\x22 class=\x22myToolbarClass\x22><button>do something</button></div></div></div>'\x0a\x09)",
|
|
|
-referencedClasses: ["Transcript"],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["asSilk", "<<", "DIV", "->", "on:bind:", "BUTTON:", "show:", "assertBodyEndsWithOneOf:"]
|
|
|
-}),
|
|
|
+}; }),
|
|
|
$globals.SilkTest);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "testOnClickEvent",
|
|
|
protocol: "testing",
|
|
|
-fn: function (){
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: [],
|
|
|
+source: "testOnClickEvent\x0a\x09\x22#on:bind\x22\x0a\x09\x0a\x09| s para |\x0a\x0a\x09s := '#fixture' asSilk.\x0a\x09para := s P: 'DOM'. \x0a\x0a\x09self timeout: 100.\x0a\x0a\x09(self async: [para on: 'click' bind:\x0a\x09\x09\x09[\x22Test successful\x22 self finished].\x0a\x0a\x09\x09'#fixture p' asJQuery trigger: 'click'.\x0a\x09\x09]) fork",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["asSilk", "P:", "timeout:", "fork", "async:", "on:bind:", "finished", "trigger:", "asJQuery"]
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
var self=this,$self=this;
|
|
|
var s,para;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -438,15 +440,7 @@ return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"testOnClickEvent",{s:s,para:para})});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: [],
|
|
|
-source: "testOnClickEvent\x0a\x09\x22#on:bind\x22\x0a\x09\x0a\x09| s para |\x0a\x0a\x09s := '#fixture' asSilk.\x0a\x09para := s P: 'DOM'. \x0a\x0a\x09self timeout: 100.\x0a\x0a\x09(self async: [para on: 'click' bind:\x0a\x09\x09\x09[\x22Test successful\x22 self finished].\x0a\x0a\x09\x09'#fixture p' asJQuery trigger: 'click'.\x0a\x09\x09]) fork",
|
|
|
-referencedClasses: [],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["asSilk", "P:", "timeout:", "fork", "async:", "on:bind:", "finished", "trigger:", "asJQuery"]
|
|
|
-}),
|
|
|
+}; }),
|
|
|
$globals.SilkTest);
|
|
|
|
|
|
|