Skip to content

Commit add43e6

Browse files
committed
Fixes an odd regression in the tracing tests
1 parent 23d87cc commit add43e6

File tree

5 files changed

+19
-38
lines changed

5 files changed

+19
-38
lines changed

packages/Babylonian-Tests.package/BPSearchCollection.class/instance/binarySearch. (bpInstrumented).st

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
as yet unclassified
22
binarySearch: anElement
3+
<layer: #bpInstrumented>
34
<exampleNamed: 'basic' active: true self: 'BPSearchCollection newFrom: (1 to: 15)' with: '15'>
45
<exampleNamed: 'not found' self: #numbersUpTo10 with: '20'>
56
<exampleNamed: 'broken example' with: ''>
67

78
| index low high flag |
8-
low := 1.
9+
self bpBlock: 1 enteredAt: thisContext.
10+
low := 1.
911
high := self size.
1012
flag := Object new.
1113

12-
[high < low] whileFalse: [
13-
index := "<bpAssert id: 7345425 for: 'BPSearchCollection>>#binarySearch:>>#''not found''' that: [:result | result < 20]>"high + low // 2"</bpAssert>".
14-
(anElement < (self at: "<bpProbe id: 3156627>"index"</bpProbe>"))
15-
ifTrue: [ high := index - 1 ]
14+
self bpBlock: 1 leftWith: ([self bpBlock: 2 enteredAt: thisContext.
15+
self bpBlock: 2 leftWith: (high < low) at: thisContext] whileFalse: [
16+
self bpBlock: 3 enteredAt: thisContext.
17+
index := (self bpAssertAfter: [high + low // 2] that: [:result | result < 20] forAssertion: 7345425 given: 'BPSearchCollection>>#binarySearch:>>#''not found''' inContext: thisContext).self bpBlock: 3 leftWith: ((anElement < (self at: (self bpTrace: [index] forProbe: 3156627 inContext: thisContext)))
18+
ifTrue: [ self bpBlock: 4 enteredAt: thisContext.
19+
self bpBlock: 4 leftWith: (high := index - 1) at: thisContext ]
1620
ifFalse: [
17-
anElement > (self at: index)
18-
ifTrue: [ "<bpProbe id: 4824443>"low := index + 1 "</bpProbe>"]
19-
ifFalse: [ ^ "<bpProbe id: 5475766>"index"</bpProbe>" ]]].
21+
self bpBlock: 5 enteredAt: thisContext.
22+
self bpBlock: 5 leftWith: (anElement > (self at: index)
23+
ifTrue: [ self bpBlock: 6 enteredAt: thisContext.
24+
self bpBlock: 6 leftWith: ((self bpTraceAssignmentOf: [low := index + 1] before: {'low' . low} forProbe: 4824443 inContext: thisContext)) at: thisContext]
25+
ifFalse: [ self bpBlock: 7 enteredAt: thisContext.
26+
^ self bpBlock: 7 leftWith: ((self bpTrace: [index] forProbe: 5475766 inContext: thisContext)) at: thisContext ]) at: thisContext]) at: thisContext]) at: thisContext.

packages/Babylonian-Tests.package/BPSearchCollection.class/methodProperties.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
"compilerClass" : "pre 11/9/2019 15:00",
44
"numbersUpTo10" : "pre 11/9/2019 15:06" },
55
"instance" : {
6-
"binarySearch:" : "pre 7/10/2020 15:59",
7-
"binarySearch: (bpInstrumented)" : "pre 7/10/2020 15:59" } }
6+
"binarySearch:" : "pre 7/10/2020 15:59" } }
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
example methods
22
methodACallingB
3+
34
| a |
4-
a := self methodB , ' and a'.
5+
a := self methodBInstrumented , ' and a'.
56
^ self bpTrace: [a] forProbe: 10 inContext: thisContext

packages/Babylonian-Tests.package/BPTestManuallyInstrumentedClass.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"aVariable:" : "pre 5/17/2019 14:10",
88
"actualMethodWithAReceiver" : "pre 7/25/2019 15:40",
99
"methodA" : "pre 7/25/2019 12:04",
10-
"methodACallingB" : "pre 7/25/2019 12:04",
10+
"methodACallingB" : "pre 10/8/2020 11:58",
1111
"methodAWithAssertionUsingExpressionResult" : "pre 11/18/2019 15:58",
1212
"methodAWithAssertionWithNonBooleanResult" : "pre 11/18/2019 16:13",
1313
"methodAWithExamplesAndAssertionWithGlobalName" : "pre 11/18/2019 13:09",

0 commit comments

Comments
 (0)