|
@@ -269,7 +269,7 @@ $globals.PlainConsumeTransformTest);
|
|
|
|
|
|
$core.addMethod(
|
|
$core.addMethod(
|
|
$core.method({
|
|
$core.method({
|
|
-selector: "testRootTransformBlockIsNotRun",
|
|
|
|
|
|
+selector: "testRootTransformBlockIsRun",
|
|
protocol: "tests",
|
|
protocol: "tests",
|
|
fn: function (){
|
|
fn: function (){
|
|
var self=this,$self=this;
|
|
var self=this,$self=this;
|
|
@@ -285,7 +285,8 @@ return $core.withContext(function($ctx2) {
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
return $recv(model)._axes_transform_([],(function(r){
|
|
return $recv(model)._axes_transform_([],(function(r){
|
|
result=r;
|
|
result=r;
|
|
-return result;
|
|
|
|
|
|
+result;
|
|
|
|
+return model;
|
|
|
|
|
|
}));
|
|
}));
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -294,18 +295,55 @@ return result;
|
|
}))._on_do_($globals.Error,(function(){
|
|
}))._on_do_($globals.Error,(function(){
|
|
|
|
|
|
}));
|
|
}));
|
|
-$self._assert_($recv(result)._isNil());
|
|
|
|
|
|
+$self._assert_equals_(result,model);
|
|
|
|
+return self;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"testRootTransformBlockIsRun",{model:model,result:result},$globals.PlainConsumeTransformTest)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: [],
|
|
|
|
+source: "testRootTransformBlockIsRun\x0a| model result |\x0aresult := nil.\x0amodel := #(2 #(1 0)).\x0a[model axes: #() transform: [:r | result := r. model]] on: Error do: [].\x0aself assert: result equals: model",
|
|
|
|
+referencedClasses: ["Error"],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["on:do:", "axes:transform:", "assert:equals:"]
|
|
|
|
+}),
|
|
|
|
+$globals.PlainConsumeTransformTest);
|
|
|
|
+
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "testRootTransformFailsOnActualChange",
|
|
|
|
+protocol: "tests",
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this,$self=this;
|
|
|
|
+var model;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+model=[(2), [(1), (0)]];
|
|
|
|
+$self._should_raise_((function(){
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+return $recv(model)._axes_transform_([],(function(r){
|
|
|
|
+return "new";
|
|
|
|
+
|
|
|
|
+}));
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+}),$globals.Error);
|
|
return self;
|
|
return self;
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
-}, function($ctx1) {$ctx1.fill(self,"testRootTransformBlockIsNotRun",{model:model,result:result},$globals.PlainConsumeTransformTest)});
|
|
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"testRootTransformFailsOnActualChange",{model:model},$globals.PlainConsumeTransformTest)});
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
},
|
|
},
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
args: [],
|
|
args: [],
|
|
-source: "testRootTransformBlockIsNotRun\x0a| model result |\x0aresult := nil.\x0amodel := #(2 #(1 0)).\x0a[model axes: #() transform: [:r | result := r]] on: Error do: [].\x0aself assert: result isNil",
|
|
|
|
|
|
+source: "testRootTransformFailsOnActualChange\x0a| model |\x0amodel := #(2 #(1 0)).\x0aself should: [model axes: #() transform: [:r | #new]] raise: Error",
|
|
referencedClasses: ["Error"],
|
|
referencedClasses: ["Error"],
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
-messageSends: ["on:do:", "axes:transform:", "assert:", "isNil"]
|
|
|
|
|
|
+messageSends: ["should:raise:", "axes:transform:"]
|
|
}),
|
|
}),
|
|
$globals.PlainConsumeTransformTest);
|
|
$globals.PlainConsumeTransformTest);
|
|
|
|
|