Explorar el Código

StringTest: add test for printString

mkroehnert hace 12 años
padre
commit
072d8af32c
Se han modificado 3 ficheros con 32 adiciones y 0 borrados
  1. 11 0
      js/Kernel-Tests.deploy.js
  2. 16 0
      js/Kernel-Tests.js
  3. 5 0
      st/Kernel-Tests.st

+ 11 - 0
js/Kernel-Tests.deploy.js

@@ -1570,6 +1570,17 @@ return self;}
 }),
 smalltalk.StringTest);
 
+smalltalk.addMethod(
+"_testPrintString",
+smalltalk.method({
+selector: "testPrintString",
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["'test_string'", smalltalk.send("test_string", "_printString", [])]);
+return self;}
+}),
+smalltalk.StringTest);
+
 smalltalk.addMethod(
 "_testSize",
 smalltalk.method({

+ 16 - 0
js/Kernel-Tests.js

@@ -2105,6 +2105,22 @@ referencedClasses: []
 }),
 smalltalk.StringTest);
 
+smalltalk.addMethod(
+"_testPrintString",
+smalltalk.method({
+selector: "testPrintString",
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["'test_string'", smalltalk.send("test_string", "_printString", [])]);
+return self;},
+args: [],
+source: "testPrintString\x0a\x0a\x09self assert: '''test_string''' equals: 'test_string' printString.",
+messageSends: ["assert:equals:", "printString"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
 smalltalk.addMethod(
 "_testSize",
 smalltalk.method({

+ 5 - 0
st/Kernel-Tests.st

@@ -1026,6 +1026,11 @@ testJoin
 	self assert: 'hello,world' equals: (',' join: #('hello' 'world'))
 !
 
+testPrintString
+
+	self assert: '''test_string''' equals: 'test_string' printString.
+!
+
 testSize
 	self assert: 'smalltalk' size equals: 9.
 	self assert: '' size equals: 0