|
@@ -5,10 +5,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "assert:",
|
|
|
category: 'testing',
|
|
|
-fn: function (aBoolean){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(self,"_assert_description_",[aBoolean,"Assertion failed"]);
|
|
|
-return self},
|
|
|
+fn: function (aBoolean) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aBoolean"],
|
|
|
source: "assert: aBoolean\x0a\x09self assert: aBoolean description: 'Assertion failed'",
|
|
|
messageSends: ["assert:description:"],
|
|
@@ -21,12 +22,13 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "assert:description:",
|
|
|
category: 'testing',
|
|
|
-fn: function (aBoolean,aString){
|
|
|
-var self=this;
|
|
|
-if(! smalltalk.assert(aBoolean)){
|
|
|
-smalltalk.send(self,"_signalFailure_",[aString]);
|
|
|
-};
|
|
|
-return self},
|
|
|
+fn: function (aBoolean, aString) {
|
|
|
+ var self = this;
|
|
|
+ if (!smalltalk.assert(aBoolean)) {
|
|
|
+ smalltalk.send(self, "_signalFailure_", [aString]);
|
|
|
+ }
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aBoolean", "aString"],
|
|
|
source: "assert: aBoolean description: aString\x0a\x09aBoolean ifFalse: [self signalFailure: aString]",
|
|
|
messageSends: ["ifFalse:", "signalFailure:"],
|
|
@@ -39,11 +41,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "assert:equals:",
|
|
|
category: 'testing',
|
|
|
-fn: function (expected,actual){
|
|
|
-var self=this;
|
|
|
-var $1;
|
|
|
-$1=smalltalk.send(self,"_assert_description_",[smalltalk.send(expected,"__eq",[actual]),smalltalk.send(smalltalk.send(smalltalk.send("Expected: ","__comma",[smalltalk.send(expected,"_asString",[])]),"__comma",[" but was: "]),"__comma",[smalltalk.send(actual,"_asString",[])])]);
|
|
|
-return $1;
|
|
|
+fn: function (expected, actual) {
|
|
|
+ var self = this;
|
|
|
+ var $1;
|
|
|
+ $1 = smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
|
|
|
+ return $1;
|
|
|
},
|
|
|
args: ["expected", "actual"],
|
|
|
source: "assert: expected equals: actual\x0a\x09^ self assert: (expected = actual) description: 'Expected: ', expected asString, ' but was: ', actual asString",
|
|
@@ -57,10 +59,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "deny:",
|
|
|
category: 'testing',
|
|
|
-fn: function (aBoolean){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(self,"_assert_",[smalltalk.send(aBoolean,"_not",[])]);
|
|
|
-return self},
|
|
|
+fn: function (aBoolean) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aBoolean"],
|
|
|
source: "deny: aBoolean\x0a\x09self assert: aBoolean not",
|
|
|
messageSends: ["assert:", "not"],
|
|
@@ -73,18 +76,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "performTestFor:",
|
|
|
category: 'running',
|
|
|
-fn: function (aResult){
|
|
|
-var self=this;
|
|
|
-smalltalk.send((function(){
|
|
|
-return smalltalk.send((function(){
|
|
|
-return smalltalk.send(self,"_perform_",[smalltalk.send(self,"_selector",[])]);
|
|
|
-}),"_on_do_",[(smalltalk.TestFailure || TestFailure),(function(ex){
|
|
|
-return smalltalk.send(aResult,"_addFailure_",[self]);
|
|
|
-})]);
|
|
|
-}),"_on_do_",[(smalltalk.Error || Error),(function(ex){
|
|
|
-return smalltalk.send(aResult,"_addError_",[self]);
|
|
|
-})]);
|
|
|
-return self},
|
|
|
+fn: function (aResult) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(function () {return smalltalk.send(function () {return smalltalk.send(self, "_perform_", [smalltalk.send(self, "_selector", [])]);}, "_on_do_", [smalltalk.TestFailure || TestFailure, function (ex) {return smalltalk.send(aResult, "_addFailure_", [self]);}]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {return smalltalk.send(aResult, "_addError_", [self]);}]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aResult"],
|
|
|
source: "performTestFor: aResult\x0a\x09[[self perform: self selector]\x0a\x09\x09on: TestFailure do: [:ex | aResult addFailure: self]]\x0a\x09\x09on: Error do: [:ex | aResult addError: self]",
|
|
|
messageSends: ["on:do:", "addError:", "addFailure:", "perform:", "selector"],
|
|
@@ -97,13 +93,14 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "runCaseFor:",
|
|
|
category: 'running',
|
|
|
-fn: function (aTestResult){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(self,"_setUp",[]);
|
|
|
-smalltalk.send(aTestResult,"_increaseRuns",[]);
|
|
|
-smalltalk.send(self,"_performTestFor_",[aTestResult]);
|
|
|
-smalltalk.send(self,"_tearDown",[]);
|
|
|
-return self},
|
|
|
+fn: function (aTestResult) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(self, "_setUp", []);
|
|
|
+ smalltalk.send(aTestResult, "_increaseRuns", []);
|
|
|
+ smalltalk.send(self, "_performTestFor_", [aTestResult]);
|
|
|
+ smalltalk.send(self, "_tearDown", []);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aTestResult"],
|
|
|
source: "runCaseFor: aTestResult\x0a\x09self setUp.\x0a\x09aTestResult increaseRuns.\x0a\x09self performTestFor: aTestResult.\x0a\x09self tearDown",
|
|
|
messageSends: ["setUp", "increaseRuns", "performTestFor:", "tearDown"],
|
|
@@ -116,9 +113,9 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "selector",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self["@testSelector"];
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return self['@testSelector'];
|
|
|
},
|
|
|
args: [],
|
|
|
source: "selector\x0a\x09^testSelector",
|
|
@@ -132,10 +129,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "setTestSelector:",
|
|
|
category: 'accessing',
|
|
|
-fn: function (aSelector){
|
|
|
-var self=this;
|
|
|
-self["@testSelector"]=aSelector;
|
|
|
-return self},
|
|
|
+fn: function (aSelector) {
|
|
|
+ var self = this;
|
|
|
+ self['@testSelector'] = aSelector;
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aSelector"],
|
|
|
source: "setTestSelector: aSelector\x0a\x09testSelector := aSelector",
|
|
|
messageSends: [],
|
|
@@ -148,9 +146,10 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "setUp",
|
|
|
category: 'running',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self},
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: [],
|
|
|
source: "setUp",
|
|
|
messageSends: [],
|
|
@@ -163,10 +162,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "should:",
|
|
|
category: 'testing',
|
|
|
-fn: function (aBlock){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(self,"_assert_",[smalltalk.send(aBlock,"_value",[])]);
|
|
|
-return self},
|
|
|
+fn: function (aBlock) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aBlock"],
|
|
|
source: "should: aBlock\x0a\x09self assert: aBlock value",
|
|
|
messageSends: ["assert:", "value"],
|
|
@@ -179,15 +179,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "should:raise:",
|
|
|
category: 'testing',
|
|
|
-fn: function (aBlock,anExceptionClass){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(self,"_assert_",[smalltalk.send((function(){
|
|
|
-smalltalk.send(aBlock,"_value",[]);
|
|
|
-return false;
|
|
|
-}),"_on_do_",[anExceptionClass,(function(ex){
|
|
|
-return true;
|
|
|
-})])]);
|
|
|
-return self},
|
|
|
+fn: function (aBlock, anExceptionClass) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return false;}, "_on_do_", [anExceptionClass, function (ex) {return true;}])]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aBlock", "anExceptionClass"],
|
|
|
source: "should: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. false] \x0a\x09\x09on: anExceptionClass \x0a\x09\x09do: [:ex | true])",
|
|
|
messageSends: ["assert:", "on:do:", "value"],
|
|
@@ -200,15 +196,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "shouldnt:raise:",
|
|
|
category: 'testing',
|
|
|
-fn: function (aBlock,anExceptionClass){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(self,"_assert_",[smalltalk.send((function(){
|
|
|
-smalltalk.send(aBlock,"_value",[]);
|
|
|
-return true;
|
|
|
-}),"_on_do_",[anExceptionClass,(function(ex){
|
|
|
-return false;
|
|
|
-})])]);
|
|
|
-return self},
|
|
|
+fn: function (aBlock, anExceptionClass) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return true;}, "_on_do_", [anExceptionClass, function (ex) {return false;}])]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aBlock", "anExceptionClass"],
|
|
|
source: "shouldnt: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. true] \x0a\x09\x09on: anExceptionClass \x0a\x09\x09do: [:ex | false])",
|
|
|
messageSends: ["assert:", "on:do:", "value"],
|
|
@@ -221,13 +213,14 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "signalFailure:",
|
|
|
category: 'private',
|
|
|
-fn: function (aString){
|
|
|
-var self=this;
|
|
|
-var $1,$2;
|
|
|
-$1=smalltalk.send((smalltalk.TestFailure || TestFailure),"_new",[]);
|
|
|
-smalltalk.send($1,"_messageText_",[aString]);
|
|
|
-$2=smalltalk.send($1,"_signal",[]);
|
|
|
-return self},
|
|
|
+fn: function (aString) {
|
|
|
+ var self = this;
|
|
|
+ var $1, $2;
|
|
|
+ $1 = smalltalk.send(smalltalk.TestFailure || TestFailure, "_new", []);
|
|
|
+ smalltalk.send($1, "_messageText_", [aString]);
|
|
|
+ $2 = smalltalk.send($1, "_signal", []);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aString"],
|
|
|
source: "signalFailure: aString\x0a\x09TestFailure new\x0a\x09\x09messageText: aString;\x0a\x09\x09signal",
|
|
|
messageSends: ["messageText:", "new", "signal"],
|
|
@@ -240,9 +233,10 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "tearDown",
|
|
|
category: 'running',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self},
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: [],
|
|
|
source: "tearDown",
|
|
|
messageSends: [],
|
|
@@ -256,16 +250,16 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "allTestSelectors",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-var $1;
|
|
|
-var selectors;
|
|
|
-selectors=smalltalk.send(self,"_testSelectors",[]);
|
|
|
-$1=smalltalk.send(self,"_shouldInheritSelectors",[]);
|
|
|
-if(smalltalk.assert($1)){
|
|
|
-smalltalk.send(selectors,"_addAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_allTestSelectors",[])]);
|
|
|
-};
|
|
|
-return selectors;
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ var $1;
|
|
|
+ var selectors;
|
|
|
+ selectors = smalltalk.send(self, "_testSelectors", []);
|
|
|
+ $1 = smalltalk.send(self, "_shouldInheritSelectors", []);
|
|
|
+ if (smalltalk.assert($1)) {
|
|
|
+ smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);
|
|
|
+ }
|
|
|
+ return selectors;
|
|
|
},
|
|
|
args: [],
|
|
|
source: "allTestSelectors\x0a\x09| selectors |\x0a\x09selectors := self testSelectors.\x0a\x09self shouldInheritSelectors ifTrue: [\x0a\x09\x09selectors addAll: self superclass allTestSelectors].\x0a\x09^selectors",
|
|
@@ -279,13 +273,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "buildSuite",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-var $1;
|
|
|
-$1=smalltalk.send(smalltalk.send(self,"_allTestSelectors",[]),"_collect_",[(function(each){
|
|
|
-return smalltalk.send(self,"_selector_",[each]);
|
|
|
-})]);
|
|
|
-return $1;
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ var $1;
|
|
|
+ $1 = smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [function (each) {return smalltalk.send(self, "_selector_", [each]);}]);
|
|
|
+ return $1;
|
|
|
},
|
|
|
args: [],
|
|
|
source: "buildSuite\x0a\x09^self allTestSelectors collect: [:each | self selector: each]",
|
|
@@ -299,11 +291,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "isAbstract",
|
|
|
category: 'testing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-var $1;
|
|
|
-$1=smalltalk.send(smalltalk.send(self,"_name",[]),"__eq",["TestCase"]);
|
|
|
-return $1;
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ var $1;
|
|
|
+ $1 = smalltalk.send(smalltalk.send(self, "_name", []), "__eq", ["TestCase"]);
|
|
|
+ return $1;
|
|
|
},
|
|
|
args: [],
|
|
|
source: "isAbstract\x0a\x09^ self name = 'TestCase'",
|
|
@@ -317,9 +309,9 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "lookupHierarchyRoot",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return (smalltalk.TestCase || TestCase);
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return smalltalk.TestCase || TestCase;
|
|
|
},
|
|
|
args: [],
|
|
|
source: "lookupHierarchyRoot\x0a\x09^TestCase",
|
|
@@ -333,14 +325,14 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "selector:",
|
|
|
category: 'accessing',
|
|
|
-fn: function (aSelector){
|
|
|
-var self=this;
|
|
|
-var $2,$3,$1;
|
|
|
-$2=smalltalk.send(self,"_new",[]);
|
|
|
-smalltalk.send($2,"_setTestSelector_",[aSelector]);
|
|
|
-$3=smalltalk.send($2,"_yourself",[]);
|
|
|
-$1=$3;
|
|
|
-return $1;
|
|
|
+fn: function (aSelector) {
|
|
|
+ var self = this;
|
|
|
+ var $2, $3, $1;
|
|
|
+ $2 = smalltalk.send(self, "_new", []);
|
|
|
+ smalltalk.send($2, "_setTestSelector_", [aSelector]);
|
|
|
+ $3 = smalltalk.send($2, "_yourself", []);
|
|
|
+ $1 = $3;
|
|
|
+ return $1;
|
|
|
},
|
|
|
args: ["aSelector"],
|
|
|
source: "selector: aSelector\x0a\x09^self new\x0a\x09\x09setTestSelector: aSelector;\x0a\x09\x09yourself",
|
|
@@ -354,11 +346,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "shouldInheritSelectors",
|
|
|
category: 'testing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-var $1;
|
|
|
-$1=smalltalk.send(self,"_~_eq",[smalltalk.send(self,"_lookupHierarchyRoot",[])]);
|
|
|
-return $1;
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ var $1;
|
|
|
+ $1 = smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
|
|
|
+ return $1;
|
|
|
},
|
|
|
args: [],
|
|
|
source: "shouldInheritSelectors\x0a\x09^self ~= self lookupHierarchyRoot",
|
|
@@ -372,13 +364,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "testSelectors",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-var $1;
|
|
|
-$1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_keys",[]),"_select_",[(function(each){
|
|
|
-return smalltalk.send(each,"_match_",["^test"]);
|
|
|
-})]);
|
|
|
-return $1;
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ var $1;
|
|
|
+ $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [function (each) {return smalltalk.send(each, "_match_", ["^test"]);}]);
|
|
|
+ return $1;
|
|
|
},
|
|
|
args: [],
|
|
|
source: "testSelectors\x0a\x09^self methodDictionary keys select: [:each | each match: '^test']",
|
|
@@ -397,10 +387,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "addError:",
|
|
|
category: 'accessing',
|
|
|
-fn: function (anError){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(smalltalk.send(self,"_errors",[]),"_add_",[anError]);
|
|
|
-return self},
|
|
|
+fn: function (anError) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["anError"],
|
|
|
source: "addError: anError\x0a\x09self errors add: anError",
|
|
|
messageSends: ["add:", "errors"],
|
|
@@ -413,10 +404,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "addFailure:",
|
|
|
category: 'accessing',
|
|
|
-fn: function (aFailure){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(smalltalk.send(self,"_failures",[]),"_add_",[aFailure]);
|
|
|
-return self},
|
|
|
+fn: function (aFailure) {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aFailure"],
|
|
|
source: "addFailure: aFailure\x0a\x09self failures add: aFailure",
|
|
|
messageSends: ["add:", "failures"],
|
|
@@ -429,9 +421,9 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "errors",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self["@errors"];
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return self['@errors'];
|
|
|
},
|
|
|
args: [],
|
|
|
source: "errors\x0a\x09^errors",
|
|
@@ -445,9 +437,9 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "failures",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self["@failures"];
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return self['@failures'];
|
|
|
},
|
|
|
args: [],
|
|
|
source: "failures\x0a\x09^failures",
|
|
@@ -461,10 +453,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "increaseRuns",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-self["@runs"]=smalltalk.send(self["@runs"],"__plus",[(1)]);
|
|
|
-return self},
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ self['@runs'] = smalltalk.send(self['@runs'], "__plus", [1]);
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: [],
|
|
|
source: "increaseRuns\x0a\x09runs := runs + 1",
|
|
|
messageSends: ["+"],
|
|
@@ -477,15 +470,16 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "initialize",
|
|
|
category: 'initialization',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-smalltalk.send(self,"_initialize",[],smalltalk.Object);
|
|
|
-self["@timestamp"]=smalltalk.send((smalltalk.Date || Date),"_now",[]);
|
|
|
-self["@runs"]=(0);
|
|
|
-self["@errors"]=smalltalk.send((smalltalk.Array || Array),"_new",[]);
|
|
|
-self["@failures"]=smalltalk.send((smalltalk.Array || Array),"_new",[]);
|
|
|
-self["@total"]=(0);
|
|
|
-return self},
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ smalltalk.send(self, "_initialize", [], smalltalk.Object);
|
|
|
+ self['@timestamp'] = smalltalk.send(smalltalk.Date || Date, "_now", []);
|
|
|
+ self['@runs'] = 0;
|
|
|
+ self['@errors'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
|
|
|
+ self['@failures'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
|
|
|
+ self['@total'] = 0;
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: [],
|
|
|
source: "initialize\x0a\x09super initialize.\x0a\x09timestamp := Date now.\x0a\x09runs := 0.\x0a\x09errors := Array new.\x0a\x09failures := Array new.\x0a\x09total := 0",
|
|
|
messageSends: ["initialize", "now", "new"],
|
|
@@ -498,9 +492,9 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "runs",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self["@runs"];
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return self['@runs'];
|
|
|
},
|
|
|
args: [],
|
|
|
source: "runs\x0a\x09^runs",
|
|
@@ -514,21 +508,21 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "status",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-var $2,$3,$1;
|
|
|
-$2=smalltalk.send(smalltalk.send(self,"_errors",[]),"_isEmpty",[]);
|
|
|
-if(smalltalk.assert($2)){
|
|
|
-$3=smalltalk.send(smalltalk.send(self,"_failures",[]),"_isEmpty",[]);
|
|
|
-if(smalltalk.assert($3)){
|
|
|
-$1="success";
|
|
|
-} else {
|
|
|
-$1="failure";
|
|
|
-};
|
|
|
-} else {
|
|
|
-$1="error";
|
|
|
-};
|
|
|
-return $1;
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ var $2, $3, $1;
|
|
|
+ $2 = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", []);
|
|
|
+ if (smalltalk.assert($2)) {
|
|
|
+ $3 = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", []);
|
|
|
+ if (smalltalk.assert($3)) {
|
|
|
+ $1 = "success";
|
|
|
+ } else {
|
|
|
+ $1 = "failure";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $1 = "error";
|
|
|
+ }
|
|
|
+ return $1;
|
|
|
},
|
|
|
args: [],
|
|
|
source: "status\x0a\x09^self errors isEmpty \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self failures isEmpty \x0a\x09\x09\x09\x09ifTrue: ['success']\x0a\x09\x09\x09\x09ifFalse: ['failure']]\x0a\x09\x09ifFalse: ['error']",
|
|
@@ -542,9 +536,9 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "timestamp",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self["@timestamp"];
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return self['@timestamp'];
|
|
|
},
|
|
|
args: [],
|
|
|
source: "timestamp\x0a\x09^timestamp",
|
|
@@ -558,9 +552,9 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "total",
|
|
|
category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self["@total"];
|
|
|
+fn: function () {
|
|
|
+ var self = this;
|
|
|
+ return self['@total'];
|
|
|
},
|
|
|
args: [],
|
|
|
source: "total\x0a\x09^total",
|
|
@@ -574,10 +568,11 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "total:",
|
|
|
category: 'accessing',
|
|
|
-fn: function (aNumber){
|
|
|
-var self=this;
|
|
|
-self["@total"]=aNumber;
|
|
|
-return self},
|
|
|
+fn: function (aNumber) {
|
|
|
+ var self = this;
|
|
|
+ self['@total'] = aNumber;
|
|
|
+ return self;
|
|
|
+},
|
|
|
args: ["aNumber"],
|
|
|
source: "total: aNumber\x0a\x09total := aNumber",
|
|
|
messageSends: [],
|