Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test class for KeyboardKey: KeyboardKeyTest.
Modified the baseline to make it loaded in images.
- Loading branch information
1 parent
f0a3778
commit 9e1023e
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
" | ||
A KeyboardKeyTest is a test class for testing the behavior of KeyboardKey | ||
" | ||
Class { | ||
#name : #KeyboardKeyTest, | ||
#superclass : #TestCase, | ||
#category : #'System-Platforms-Tests-Utilities' | ||
} | ||
|
||
{ #category : #tests } | ||
KeyboardKeyTest >> testNamed [ | ||
"These assertions have been written using data available in KeyboardKey class>>#initializeKeyTable" | ||
self assert: (KeyboardKey named: 'Shift_L') equals: (KeyboardKey value: 65505). | ||
|
||
self assert: (KeyboardKey named: 'Left') equals: (KeyboardKey value: 65361). | ||
|
||
self assert: (KeyboardKey named: 'Alt_R') equals: (KeyboardKey value: 65514). | ||
|
||
self assert: (KeyboardKey named: 'a') equals: (KeyboardKey value: 97). | ||
|
||
self assert: (KeyboardKey named: 'A') equals: (KeyboardKey value: 65). | ||
] | ||
|
||
{ #category : #tests } | ||
KeyboardKeyTest >> testValue [ | ||
| key | | ||
key := KeyboardKey value: 65505. | ||
self assert: key value equals: 65505. | ||
self assert: key name equals: 'Shift_L'. | ||
|
||
key := KeyboardKey value: 65361. | ||
self assert: key value equals: 65361. | ||
self assert: key name equals: 'Left'. | ||
|
||
key := KeyboardKey value: 65514. | ||
self assert: key value equals: 65514. | ||
self assert: key name equals: 'Alt_R'. | ||
|
||
key := KeyboardKey value: 97. | ||
self assert: key value equals: 97. | ||
self assert: key name equals: 'a'. | ||
|
||
key := KeyboardKey value: 65. | ||
self assert: key value equals: 65. | ||
self assert: key name equals: 'A'. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : #'System-Platforms-Tests' } |