ResumableTestFailure.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 13:11:58 +0100
branchjv
changeset 724 4dae63fce9f9
parent 664 e31b2e7b658d
permissions -rw-r--r--
vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present - All source *.st files are now Unicode UTF8 without BOM Files are in two groups (fileOut works this way in Smalltalk/X): - containing a unicode character have "{ Encoding: utf8 }" at the header - ASCII only are without the header
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
724
4dae63fce9f9 vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 664
diff changeset
     1
"{ Encoding: utf8 }"
4dae63fce9f9 vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 664
diff changeset
     2
105
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:goodies/sunit' }"
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     4
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
     5
"{ NameSpace: Smalltalk }"
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
     6
105
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     7
TestFailure subclass:#ResumableTestFailure
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     8
	instanceVariableNames:''
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     9
	classVariableNames:''
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    10
	poolDictionaries:''
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    11
	category:'SUnit-Preload'
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    12
!
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    13
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    14
!ResumableTestFailure class methodsFor:'documentation'!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    15
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    16
documentation
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    17
"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    18
   Sometimes it is useful to see when debugging (and/or to log when running) the results from several assertions in a test.  Example:
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    19
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    20
	#(‘same’ ‘*’ ‘*.txt’ ‘a*c’) with: #(‘same’ ‘any’ ‘some.txt’ ‘abc’) do:
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    21
		[:eachMeta :eachString |
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    22
		self assert: (eachMeta match: eachString)
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    23
			description: (‘<1s> does not match <2s>’ expandMacrosWith: eachMeta with: eachString)
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    24
			resumable: true].
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    25
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    26
Raising a ResumableTestFailure means that all the assertions will be run (if the test case is logging, this will print out a message to the log for each one that fails).  When debugging, the user can hit ''proceed'' to continue the test and see which other expressions do not match.'
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    27
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    28
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    29
"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    30
! !
105
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    31
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    32
!ResumableTestFailure methodsFor:'Camp Smalltalk'!
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    33
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    34
handleFailureWith:something
105
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    35
    "resumable test failure. Continue with the test suite"
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    36
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    37
    ^ self resumeWith:something
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    38
!
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    39
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    40
mayProceed
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    41
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    42
    ^ true
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    43
!
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    44
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    45
sunitExitWith: aValue
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    46
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    47
	^self resume: aValue
105
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    48
! !
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    49
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    50
!ResumableTestFailure class methodsFor:'documentation'!
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    51
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    52
version
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    53
    ^ '$Header: /cvs/stx/stx/goodies/sunit/ResumableTestFailure.st,v 1.2 2011-06-29 19:15:49 cg Exp $'
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    54
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    55
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
    56
version_HG
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
    57
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
    58
    ^ '$Changeset: <not expanded> $'
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
    59
!
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
    60
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
    61
version_SVN
724
4dae63fce9f9 vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 664
diff changeset
    62
    ^ '�Id: ResumableTestFailure.st 204 2010-09-11 15:21:51Z vranyj1 �'
105
d1f46b4e732a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    63
! !
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
    64