Skip to content

Commit

Permalink
Merge pull request #161 from hpi-swa-teaching/implement-#140
Browse files Browse the repository at this point in the history
#140: Coverage improvements
  • Loading branch information
sinnaj-r authored Aug 6, 2020
2 parents 5ffe3f5 + c4959db commit 15ecd34
Show file tree
Hide file tree
Showing 55 changed files with 123 additions and 101 deletions.
5 changes: 0 additions & 5 deletions packages/Algernon.package/ALGAction.class/class/validVerbs.st

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"class" : {
"createListOfAlgeractionsGiven:" : "J.J. 7/28/2015 19:16",
"validVerbs" : "rk 7/14/2020 10:06",
"withName:rank:target:selector:args:" : "J.J. 7/28/2015 19:15" },
"instance" : {
"actionVerb" : "beb 6/25/2020 10:17",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ createFrom: anAction

| item type |
type := ALGActionType newFor: anAction.
item := self new.
item algerType: type;
algerActions: (OrderedCollection newFrom: {anAction});
numTimesSelected: anAction numTimesSelected.
item := self withAlgertype: type.
item numTimesSelected: anAction numTimesSelected.
^ item
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"class" : {
"createFrom:" : "beb 6/18/2020 17:02",
"createFrom:" : "jRo 8/5/2020 15:02",
"createListFrom:" : "beb 5/31/2020 18:26" },
"instance" : {
"name" : "td 6/8/2016 21:04",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ createActionDo
^ ALGAction
withName: 'do'
rank: 1
target: self
target: self action
selector: #do
args: OrderedCollection new
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"action" : "J.J. 7/11/2015 18:24",
"action:" : "J.J. 7/30/2015 17:05",
"createActionDo" : "J.J. 7/30/2015 17:11",
"createActionDo" : "jRo 8/5/2020 15:07",
"createListOfAlgeractions" : "J.J. 7/30/2015 19:58",
"name" : "beb 5/21/2020 10:30",
"rankBonus" : "beb 7/1/2020 13:15",
Expand Down
5 changes: 0 additions & 5 deletions packages/Algernon.package/ALGCache.class/instance/at..st

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"allMatchedItems:" : "beb 7/2/2020 15:04",
"allMatchedItemsAt:" : "beb 7/2/2020 15:05",
"allMatchedItemsAt:put:" : "beb 7/2/2020 17:16",
"at:" : "beb 7/2/2020 15:04",
"clear" : "beb 7/2/2020 17:00",
"emptyResult" : "beb 7/2/2020 15:14",
"finalResults" : "beb 7/2/2020 15:04",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
actions
open: aCategory inBrowser: aBrowser

aBrowser systemCategoryListIndex: (aBrowser systemCategoryList indexOf: aCategory)
aBrowser selectSystemCategory: aCategory
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"createActionFileoutFor:" : "J.J. 7/30/2015 17:38",
"createListOfAlgeractions" : "JS 6/21/2016 23:14",
"hasChildren" : "fw 7/30/2015 14:18",
"open:inBrowser:" : "J.J. 7/30/2015 17:15",
"open:inBrowser:" : "jRo 8/5/2020 15:43",
"typeName" : "J.J. 7/30/2015 17:15" } }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ computeScore: anItem given: aQueryString
anItem algerType hasComment ifFalse: [ ^ nil ].
score := self scoreBetween: aQueryString and: anItem algerType comment.
score ifNil: [ ^ nil ].

^ score negated + self classCommentFuzzyPenalty
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"afterPenalty" : "beb 8/1/2020 10:16",
"beforePenalty" : "beb 8/1/2020 10:15",
"classCommentFuzzyPenalty" : "beb 8/1/2020 10:15",
"computeScore:given:" : "rk 8/3/2020 16:45" },
"computeScore:given:" : "jRo 8/5/2020 16:26" },
"instance" : {
} }
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
preferences
setKeyboardBinding: aString
setKeyboardBinding: aString
self activationString: aString.
^true

^ true
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ setKeyboardBinding
category: #Algernon
description: 'Set the keyboard shortcut to open Algernon.'
type: #String>
^self activationString
^ self activationString


Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ deactivate: hand
reset;
stopStepping;
hideMorphs.
hand ifNotNil: [self dropFocus: hand].
ALGInstallation instance cleanupIfNewDay.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
events-processing
dropFocus: hand
hand newKeyboardFocus: self oldKeyboardFocus;
newMouseFocus: self oldMouseFocus.
self oldKeyboardFocus: nil;
oldMouseFocus: nil
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
updating
systemChanged: evt
self unsubscribeFromNotifiers.
self wasChanged: evt
11 changes: 6 additions & 5 deletions packages/Algernon.package/ALGCore.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"initializeAlgernon" : "mt 10/20/2015 14:32:03",
"initializeGlobalKeyBindings" : "jRo 7/13/2020 15:29",
"keyBindings" : "J.J. 7/31/2015 20:31",
"open" : "LK 5/12/2016 20:45",
"setKeyboardBinding" : "AKK 5/11/2016 17:35",
"setKeyboardBinding:" : "AKK 5/11/2016 17:42",
"open" : "jRo 8/5/2020 15:17",
"setKeyboardBinding" : "jRo 8/5/2020 15:56",
"setKeyboardBinding:" : "jRo 8/5/2020 15:55",
"title" : "J.J. 7/28/2015 19:29" },
"instance" : {
"activate" : "beb 6/29/2020 09:17",
Expand All @@ -37,9 +37,10 @@
"createInputHelper" : "J.J. 7/30/2015 19:40",
"currentItem" : "J.J. 7/30/2015 20:25",
"deactivate" : "topa 3/24/2015 14:11",
"deactivate:" : "jRo 8/1/2020 19:06",
"deactivate:" : "jRo 8/5/2020 15:10",
"delete" : "beb 7/16/2020 10:12",
"doActionOnSelectedEvent:" : "jRo 8/1/2020 19:32",
"dropFocus:" : "jRo 8/6/2020 11:13",
"filteringThreshold" : "DS 5/21/2017 16:54",
"firstOnSearchStack" : "jRo 6/14/2020 18:21",
"firstStep:" : "DS 5/21/2017 16:43",
Expand Down Expand Up @@ -97,7 +98,7 @@
"showParentList" : "jRo 8/1/2020 13:28",
"step" : "DS 6/2/2017 15:01",
"stepTime" : "DS 5/21/2017 16:53",
"systemChanged:" : "beb 7/15/2020 16:15",
"systemChanged:" : "jRo 8/5/2020 16:47",
"textField" : "J.J. 7/27/2015 21:10",
"textField:" : "J.J. 7/27/2015 21:10",
"toggleVisibility:" : "JF 5/7/2015 14:35",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"globalVariableIcon" : "fw 7/21/2015 22:02",
"helpIcon" : "beb 5/20/2020 17:42",
"iconFor:" : "jRo 5/31/2020 15:35",
"iconNames" : "jRo 8/1/2020 11:04",
"iconSize" : "J.J. 7/30/2015 15:07",
"iconSizeItemType" : "jRo 5/31/2020 15:16",
"initializeFileMapping" : "rk 7/15/2020 16:02",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
wouldAcceptKeyboardFocusUponTab
^false
^ false
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"moveCursorToEnd" : "rk 6/17/2020 14:00",
"normalKeyStroke:" : "jRo 7/13/2020 15:33",
"size" : "beb 5/23/2020 16:04",
"wouldAcceptKeyboardFocusUponTab" : "jRo 7/13/2020 15:26" } }
"wouldAcceptKeyboardFocusUponTab" : "jRo 8/5/2020 16:20" } }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
instance creation
withAlgertype: aType
^ (ALGItem new) updateAlgertype: aType
^ (self new) updateAlgertype: aType

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
accessing
numTimesSelected: anInt
numTimesSelected := anInt.
self lastUsage: DateAndTime now
self lastUsage: DateAndTime now

3 changes: 2 additions & 1 deletion packages/Algernon.package/ALGItem.class/instance/rank.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ accessing
rank
| timeStampFactor |
timeStampFactor := 1 / (((DateAndTime now - self lastUsage) asSeconds) + 1).
^ self rankBonus + (self numTimesSelected + 1) + (timeStampFactor * self numTimesSelected) squared
^ self rankBonus + (self numTimesSelected + 1) + (timeStampFactor * self numTimesSelected) squared

16 changes: 7 additions & 9 deletions packages/Algernon.package/ALGItem.class/methodProperties.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"class" : {
"add:toDict:atValue:" : "LK 6/1/2016 22:00",
"withAlgertype:" : "rk 8/3/2020 16:46",
"withAlgertype:relevantForEmptyString:" : "beb 6/30/2020 10:45" },
"withAlgertype:" : "jRo 8/5/2020 15:01" },
"instance" : {
"algerActions" : "td 6/8/2016 21:04",
"algerActions:" : "td 6/8/2016 21:04",
Expand All @@ -28,16 +26,16 @@
"isLessThan:given:" : "td 6/29/2016 08:20",
"isLessThan:or:given:" : "pw 8/4/2020 10:26",
"isRelevantForAllStrings" : "beb 6/25/2020 10:11",
"lastUsage" : "rk 8/4/2020 21:05",
"lastUsage:" : "rk 8/4/2020 21:05",
"lowerCaseName" : "rk 8/4/2020 21:02",
"lastUsage" : "jRo 8/5/2020 15:31",
"lastUsage:" : "jRo 8/5/2020 15:31",
"lowerCaseName" : "beb 5/21/2020 10:28",
"matchesAction:" : "beb 6/18/2020 17:52",
"name" : "jRo 5/28/2020 19:53",
"nameLessThan:given:" : "pw 8/5/2020 09:11",
"numTimesSelected" : "rk 8/4/2020 21:02",
"numTimesSelected:" : "rk 8/4/2020 21:08",
"numTimesSelected" : "jRo 6/14/2020 01:19",
"numTimesSelected:" : "jRo 8/5/2020 15:32",
"printOn:" : "J.J. 7/30/2015 15:34",
"rank" : "rk 8/4/2020 21:09",
"rank" : "jRo 8/5/2020 15:28",
"rankBonus" : "beb 7/1/2020 13:14",
"rankLessThan:" : "pw 8/3/2020 23:56",
"resetDefaultIndex" : "beb 7/31/2020 17:27",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"class" : {
"classCommentFuzzyPenalty" : "beb 7/3/2020 13:42",
"helpTexts" : "beb 5/20/2020 15:39",
"keywords" : "beb 6/30/2020 11:59" },
"instance" : {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"initializeItems" : "rk 7/15/2020 15:58",
"minimumItemsToCompute" : "beb 6/30/2020 19:47",
"newIn:" : "J.J. 7/30/2015 22:00",
"reset" : "J.J. 7/27/2015 17:29",
"searchDelimeter" : "J.J. 7/28/2015 17:11" },
"instance" : {
"cache" : "beb 7/16/2020 10:21",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"add:target:selector:argumentList:" : "jRo 8/1/2020 01:18",
"addAll:" : "beb 8/1/2020 13:45",
"addCategory:" : "rk 8/4/2020 21:29",
"cleanUp" : "beb 7/14/2020 09:10",
"controller" : "rk 8/3/2020 16:48",
"controller:" : "rk 8/4/2020 21:29",
"doActionOnSelectedItem:" : "jRo 8/1/2020 19:33",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
helpers
getResultItemForType: aTypeString
self items detect: [:eachItem | eachItem typeName = aTypeString]
self items detect: [:eachItem | eachItem algerType typeName = aTypeString]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
previousAlgernonSingleton: anObject
previousAlgernonSingleton := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
previousAlgernonSingleton
^ previousAlgernonSingleton
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
running
setUp
self previousAlgernonSingleton: Algernon currentInstance.
Algernon currentInstance: self algInstance.
ClassOrganizer allInstancesDo: [:ea | ea removeEmptyCategories].
self previouslyOpenedWindows: self currentSystemWindows.
self algInstance activate.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
running
tearDown
self algInstance deactivate: nil.
self algInstance deactivate.
(self currentSystemWindows difference: self previouslyOpenedWindows)
do: [:each | each delete]
do: [:each | each delete].
Algernon currentInstance: self previousAlgernonSingleton.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
"ensureMorphic" : "rk 8/4/2020 20:39",
"findNewSystemWindowsByLabel:old:" : "jRo 5/27/2020 17:44",
"findSystemWindowsByLabel:" : "jRo 6/4/2020 15:08",
"getResultItemForType:" : "jRo 5/27/2020 15:44",
"getResultItemForType:" : "jRo 8/5/2020 16:37",
"isMorphic" : "rk 8/4/2020 20:40",
"itemMorphs" : "jRo 8/1/2020 11:39",
"itemProviderSearch:" : "jRo 8/1/2020 11:23",
"items" : "jRo 8/1/2020 11:40",
"moveCursorTo:" : "jRo 7/5/2020 22:15",
"nameOfFirstResult" : "pw 7/8/2020 21:41",
"previousAlgernonSingleton" : "jRo 8/6/2020 10:59",
"previousAlgernonSingleton:" : "jRo 8/6/2020 10:59",
"previouslyOpenedWindows" : "jRo 7/2/2020 10:52",
"previouslyOpenedWindows:" : "jRo 7/2/2020 10:52",
"resultsClassIncludeName:" : "jRo 8/1/2020 11:51",
Expand Down
4 changes: 3 additions & 1 deletion packages/AlgernonTests.package/ALGTest.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"LastResetSeconds" ],
"commentStamp" : "JS 7/12/2016 10:56",
"instvars" : [
"previouslyOpenedWindows" ],
"algerInstance",
"previouslyOpenedWindows",
"previousAlgernonSingleton" ],
"name" : "ALGTest",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
testing
testAlgernonChangeShortcut: shortcut
ALGCore activationString: shortcut shallowCopy.
ALGCore setKeyboardBinding: shortcut copy.
self algInstance deactivate: nil.
self deny: self algInstance active.
self algInstance handleListenEvent: (ALGFakeKeyboardEvent new keyString: shortcut shallowCopy;
Expand Down

This file was deleted.

Loading

0 comments on commit 15ecd34

Please sign in to comment.