The Trunk: KernelTests-pre.352.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: KernelTests-pre.352.mcz

commits-2
Patrick Rein uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-pre.352.mcz

==================== Summary ====================

Name: KernelTests-pre.352
Author: pre
Time: 1 November 2018, 2:39:41.00256 pm
UUID: d4afdebb-ef21-5340-a543-d8e897962963
Ancestors: KernelTests-ul.351

Adds tests for the valueSupplyingAnswer: protocol i n preparation of the new ProvideAnswerNotification handling.

=============== Diff against KernelTests-ul.351 ===============

Item was changed:
+ ----- Method: BlockClosureTest>>testSupplyAnswerOfFillInTheBlank (in category 'tests - supply answer') -----
- ----- Method: BlockClosureTest>>testSupplyAnswerOfFillInTheBlank (in category 'testing') -----
  testSupplyAnswerOfFillInTheBlank
 
+ UIManager subclassesDo: [:managerClass |
+ self should: ['blue' = ([managerClass new request: 'Your favorite color?']
+ valueSupplyingAnswer: #('Your favorite color?' 'blue'))]]!
- self should: ['blue' = ([UIManager default request: 'Your favorite color?']
- valueSupplyingAnswer: #('Your favorite color?' 'blue'))]!

Item was changed:
+ ----- Method: BlockClosureTest>>testSupplyAnswerOfFillInTheBlankUsingDefaultAnswer (in category 'tests - supply answer') -----
- ----- Method: BlockClosureTest>>testSupplyAnswerOfFillInTheBlankUsingDefaultAnswer (in category 'testing') -----
  testSupplyAnswerOfFillInTheBlankUsingDefaultAnswer
 
+ UIManager subclassesDo: [:managerClass |
+ self should: ['red' = ([managerClass new request: 'Your favorite color?' initialAnswer: 'red']
+ valueSupplyingAnswer: #('Your favorite color?' #default))]]!
- self should: ['red' = ([UIManager default  request: 'Your favorite color?' initialAnswer: 'red']
- valueSupplyingAnswer: #('Your favorite color?' #default))]!

Item was changed:
+ ----- Method: BlockClosureTest>>testSupplyAnswerUsingOnlySubstringOfQuestion (in category 'tests - supply answer') -----
- ----- Method: BlockClosureTest>>testSupplyAnswerUsingOnlySubstringOfQuestion (in category 'tests') -----
  testSupplyAnswerUsingOnlySubstringOfQuestion
 
+ UIManager subclassesDo: [:managerClass |
+ self should: [false = ([managerClass new confirm: 'You like Smalltalk?']
+ valueSupplyingAnswer: #('like' false))]]!
- self should: [false = ([self confirm: 'You like Smalltalk?']
- valueSupplyingAnswer: #('like' false))]!

Item was changed:
+ ----- Method: BlockClosureTest>>testSupplyAnswerUsingRegexMatchOfQuestion (in category 'tests - supply answer') -----
- ----- Method: BlockClosureTest>>testSupplyAnswerUsingRegexMatchOfQuestion (in category 'tests') -----
  testSupplyAnswerUsingRegexMatchOfQuestion
 
  (String includesSelector: #matchesRegex:) ifFalse: [^ self].
 
+ UIManager subclassesDo: [:managerClass |
+ self should: [true = ([managerClass new confirm: 'You like Smalltalk?']
+ valueSupplyingAnswer: #('.*Smalltalk\?' true))]]!
- self should: [true = ([self confirm: 'You like Smalltalk?']
- valueSupplyingAnswer: #('.*Smalltalk\?' true))]!

Item was changed:
+ ----- Method: BlockClosureTest>>testSupplySpecificAnswerToQuestion (in category 'tests - supply answer') -----
- ----- Method: BlockClosureTest>>testSupplySpecificAnswerToQuestion (in category 'tests') -----
  testSupplySpecificAnswerToQuestion
 
+ UIManager subclassesDo: [:managerClass |
+ self should: [false = ([managerClass new confirm: 'You like Smalltalk?']
+ valueSupplyingAnswer: #('You like Smalltalk?' false))]]!
- self should: [false = ([self confirm: 'You like Smalltalk?']
- valueSupplyingAnswer: #('You like Smalltalk?' false))]!

Item was changed:
+ ----- Method: BlockClosureTest>>testSuppressInform (in category 'tests - supply answer') -----
- ----- Method: BlockClosureTest>>testSuppressInform (in category 'tests') -----
  testSuppressInform
+
+ UIManager subclassesDo: [:managerClass | | manager |
+ manager := managerClass new.
+ self should: [[manager inform: 'Should not see this message or this test failed!!']
+ valueSuppressingAllMessages]]!
-
- self should: [[nil inform: 'Should not see this message or this test failed!!'] valueSuppressingAllMessages isNil]!

Item was changed:
+ ----- Method: BlockClosureTest>>testSuppressInformUsingStringMatchOptions (in category 'tests - supply answer') -----
- ----- Method: BlockClosureTest>>testSuppressInformUsingStringMatchOptions (in category 'tests') -----
  testSuppressInformUsingStringMatchOptions
 
+ UIManager subclassesDo: [:managerClass | | manager |
+ manager := managerClass new.
+ #("message" "pattern"
+ 'Should not see this message or this test failed!!' 'Should not see this message or this test failed!!'
+ 'Should not see this message or this test failed!!' 'not see this message'
+ 'Should not see this message or this test failed!!' '*message*failed#')
+ pairsDo: [:message :pattern |
+ self assert: ([manager inform: message] valueSuppressingMessages: {pattern})]]!
- self should: [([nil inform: 'Should not see this message or this test failed!!'] valueSuppressingMessages: #('Should not see this message or this test failed!!')) isNil].
-
- self should: [([nil inform: 'Should not see this message or this test failed!!'] valueSuppressingMessages: #('not see this message')) isNil].
-
- self should: [([nil inform: 'Should not see this message or this test failed!!'] valueSuppressingMessages: #('*message*failed#')) isNil]!