Browse Source

Fixed base testFirstN, using it in ArrayTest

Herbert Vojčík 11 years ago
parent
commit
62805574a3
2 changed files with 3 additions and 23 deletions
  1. 2 18
      js/Kernel-Tests.js
  2. 1 5
      st/Kernel-Tests.st

+ 2 - 18
js/Kernel-Tests.js

@@ -2815,7 +2815,7 @@ $1=_st($2)._first_((2));
 $ctx1.sendIdx["first:"]=1;
 $4=self._collection();
 $ctx1.sendIdx["collection"]=2;
-$3=_st($4)._copyFrom_to_((0),(2));
+$3=_st($4)._copyFrom_to_((1),(2));
 self._assert_equals_($1,$3);
 self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -2823,7 +2823,7 @@ return _st(self._collection())._first_((33));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
 return self}, function($ctx1) {$ctx1.fill(self,"testFirstN",{},smalltalk.SequenceableCollectionTest)})},
 args: [],
-source: "testFirstN\x0a\x09self \x0a\x09\x09assert: (self collection first: 2) \x0a\x09\x09equals: (self collection copyFrom: 0 to: 2).\x0a\x09\x09\x0a\x09self should: [ self collection first: 33 ] raise: Error",
+source: "testFirstN\x0a\x09self \x0a\x09\x09assert: (self collection first: 2) \x0a\x09\x09equals: (self collection copyFrom: 1 to: 2).\x0a\x09\x09\x0a\x09self should: [ self collection first: 33 ] raise: Error",
 messageSends: ["assert:equals:", "first:", "collection", "copyFrom:to:", "should:raise:"],
 referencedClasses: ["Error"]
 }),
@@ -3076,22 +3076,6 @@ referencedClasses: []
 }),
 smalltalk.ArrayTest);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testFirstN",
-protocol: 'tests',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._assert_equals_(_st([(1),(2),(3),(4),(5)])._first_((3)),[(1),(2),(3)]);
-return self}, function($ctx1) {$ctx1.fill(self,"testFirstN",{},smalltalk.ArrayTest)})},
-args: [],
-source: "testFirstN\x0a\x09self assert: ({1. 2. 3. 4. 5} first: 3) equals: {1. 2. 3}",
-messageSends: ["assert:equals:", "first:"],
-referencedClasses: []
-}),
-smalltalk.ArrayTest);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testIfEmpty",

+ 1 - 5
st/Kernel-Tests.st

@@ -855,7 +855,7 @@ testFirst
 testFirstN
 	self 
 		assert: (self collection first: 2) 
-		equals: (self collection copyFrom: 0 to: 2).
+		equals: (self collection copyFrom: 1 to: 2).
 		
 	self should: [ self collection first: 33 ] raise: Error
 !
@@ -923,10 +923,6 @@ testAtIfAbsent
 	self assert: (array at: 3 ifAbsent: [ 'not found' ]) equals: 'not found'.
 !
 
-testFirstN
-	self assert: ({1. 2. 3. 4. 5} first: 3) equals: {1. 2. 3}
-!
-
 testIfEmpty
 	self assert: ( '' ifEmpty: [ 'zork' ] ) equals: 'zork'
 !