Ver Fonte

Merge pull request #504 from kpullen/test-keymaps

Ensure that keymaps returned by HLCodeWidget are collections of associations
Nicolas Petton há 11 anos atrás
pai
commit
d3a1fd0503

+ 1 - 1
helios.html

@@ -22,7 +22,7 @@
           'Spaces', 'Helios-Core', 'Helios-Exceptions', 'Helios-Commands-Core',
           'Helios-Commands-Tools', 'Helios-Commands-Browser', 'Helios-Layout', 'Helios-KeyBindings',
           'Helios-Browser', 'Helios-Workspace', 'Helios-Transcript', 'Helios-Debugger',
-          'Helios-Inspector', 'Helios-References', 'Helios-Announcements'
+          'Helios-Inspector', 'Helios-References', 'Helios-Announcements', 'Helios-Workspace-Tests'
         ]})
 
         window.onbeforeunload = function() {

+ 18 - 0
js/Helios-Workspace-Tests.deploy.js

@@ -0,0 +1,18 @@
+smalltalk.addPackage('Helios-Workspace-Tests');
+smalltalk.addClass('HLCodeWidgetTest', smalltalk.TestCase, [], 'Helios-Workspace-Tests');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "testKeyMap",
+fn: function (){
+var self=this;
+function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
+function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
+return smalltalk.withContext(function($ctx1) { 
+_st(self)._assert_(_st(_st($HLCodeWidget())._pcKeyMap())._isKindOf_($HashedCollection()));
+_st(self)._assert_(_st(_st($HLCodeWidget())._macKeyMap())._isKindOf_($HashedCollection()));
+return self}, function($ctx1) {$ctx1.fill(self,"testKeyMap",{},smalltalk.HLCodeWidgetTest)})},
+messageSends: ["assert:", "isKindOf:", "pcKeyMap", "macKeyMap"]}),
+smalltalk.HLCodeWidgetTest);
+
+
+

+ 23 - 0
js/Helios-Workspace-Tests.js

@@ -0,0 +1,23 @@
+smalltalk.addPackage('Helios-Workspace-Tests');
+smalltalk.addClass('HLCodeWidgetTest', smalltalk.TestCase, [], 'Helios-Workspace-Tests');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "testKeyMap",
+category: 'tests',
+fn: function (){
+var self=this;
+function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
+function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
+return smalltalk.withContext(function($ctx1) { 
+_st(self)._assert_(_st(_st($HLCodeWidget())._pcKeyMap())._isKindOf_($HashedCollection()));
+_st(self)._assert_(_st(_st($HLCodeWidget())._macKeyMap())._isKindOf_($HashedCollection()));
+return self}, function($ctx1) {$ctx1.fill(self,"testKeyMap",{},smalltalk.HLCodeWidgetTest)})},
+args: [],
+source: "testKeyMap\x0a\x22Key maps are a collection of associations.\x22\x0aself assert: ( HLCodeWidget pcKeyMap isKindOf: HashedCollection ).\x0aself assert: ( HLCodeWidget macKeyMap isKindOf: HashedCollection ).",
+messageSends: ["assert:", "isKindOf:", "pcKeyMap", "macKeyMap"],
+referencedClasses: ["HashedCollection", "HLCodeWidget"]
+}),
+smalltalk.HLCodeWidgetTest);
+
+
+

+ 13 - 0
st/Helios-Workspace-Tests.st

@@ -0,0 +1,13 @@
+Smalltalk current createPackage: 'Helios-Workspace-Tests'!
+TestCase subclass: #HLCodeWidgetTest
+	instanceVariableNames: ''
+	package: 'Helios-Workspace-Tests'!
+
+!HLCodeWidgetTest methodsFor: 'tests'!
+
+testKeyMap
+"Key maps are a collection of associations."
+self assert: ( HLCodeWidget pcKeyMap isKindOf: HashedCollection ).
+self assert: ( HLCodeWidget macKeyMap isKindOf: HashedCollection ).
+! !
+