Explorar o código

SymbolTest: add test for printString

mkroehnert %!s(int64=12) %!d(string=hai) anos
pai
achega
013f7af732
Modificáronse 3 ficheiros con 32 adicións e 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

@@ -1727,6 +1727,17 @@ return self;}
 }),
 smalltalk.SymbolTest);
 
+smalltalk.addMethod(
+"_testPrintString",
+smalltalk.method({
+selector: "testPrintString",
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["#symbol", smalltalk.send(smalltalk.symbolFor("symbol"), "_printString", [])]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
 smalltalk.addMethod(
 "_testSize",
 smalltalk.method({

+ 16 - 0
js/Kernel-Tests.js

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

+ 5 - 0
st/Kernel-Tests.st

@@ -1114,6 +1114,11 @@ testIsSymbolIsString
 	self assert: 'hello' isString
 !
 
+testPrintString
+
+	self assert: '#symbol' equals: #symbol printString.
+!
+
 testSize
 	self assert: #a size equals: 1.
 	self assert: #aaaaa size equals: 5