probatio 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/probatio.rb +37 -6
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb5913d7a89604bdcb77a726382d5b50c333df3be906872e1484d540f04d162b
|
|
4
|
+
data.tar.gz: 176cd56812b6aee807da7fedce98243e9a0bbc8e1a2b835a251dc406e4b4920d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 857a906c0174eb4501b641db7da24ca8685c4b6062c5d7366db1287118228a2371731781d818a4edcf33f3333f8dd5a781193ccd8c42cffc5dbb3bb612aa1c17
|
|
7
|
+
data.tar.gz: 15650e10842cbcfd0b81747ba46bd222a4d4b9a42720ade1b25cdb8ee6972b1c4d5fd09a73b49778f8a1311c4b0245e5bc345be66527c0cdc49528815ca81d99
|
data/CHANGELOG.md
CHANGED
data/lib/probatio.rb
CHANGED
|
@@ -18,7 +18,7 @@ require 'probatio/more'
|
|
|
18
18
|
|
|
19
19
|
module Probatio
|
|
20
20
|
|
|
21
|
-
VERSION = '1.4.
|
|
21
|
+
VERSION = '1.4.2'
|
|
22
22
|
|
|
23
23
|
class << self
|
|
24
24
|
|
|
@@ -101,6 +101,8 @@ module Probatio
|
|
|
101
101
|
read_test_file(root_group, fpath)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
+
rework_line_numbers(root_group)
|
|
105
|
+
|
|
104
106
|
run_opts[:filen] = rework_filen(root_group, run_opts)
|
|
105
107
|
|
|
106
108
|
dbg_s { Cerata.vertical_h_to_s(run_opts, ' run_opts| ') }
|
|
@@ -200,7 +202,9 @@ module Probatio
|
|
|
200
202
|
fmap = map[fn[0]]
|
|
201
203
|
fline = fn[1]
|
|
202
204
|
|
|
203
|
-
n = fmap
|
|
205
|
+
n = fmap
|
|
206
|
+
.select { |l0, l1, n| fline >= l0 && (fline <= l1 || l1 < 1) }
|
|
207
|
+
.last
|
|
204
208
|
|
|
205
209
|
return [ fn ] if n && n[2].is_a?(Probatio::Test)
|
|
206
210
|
|
|
@@ -235,6 +239,32 @@ module Probatio
|
|
|
235
239
|
|
|
236
240
|
fs.any? ? fs : do_locate(File.dirname(dir), suffixes)
|
|
237
241
|
end
|
|
242
|
+
|
|
243
|
+
def rework_line_numbers(root_group)
|
|
244
|
+
|
|
245
|
+
# if the start line is 0, set it to the end line
|
|
246
|
+
# if the end line is 0, set it to the file's last line
|
|
247
|
+
#
|
|
248
|
+
root_group.map.each do |path, groups|
|
|
249
|
+
groups.each do |llg|
|
|
250
|
+
llg[0] = llg[1] if llg[0] == 0
|
|
251
|
+
llg[1] = File.readlines(path).count if llg[1] == 0
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# ensure that group end lines are their last child's end line
|
|
256
|
+
#
|
|
257
|
+
root_group
|
|
258
|
+
.map
|
|
259
|
+
.inject([]) { |a, (_, groups)|
|
|
260
|
+
groups.each { |llg| a << llg if llg[2].is_a?(Probatio::Group) }
|
|
261
|
+
a }
|
|
262
|
+
.reverse
|
|
263
|
+
.each { |llg|
|
|
264
|
+
g = llg[2]; next if g.name == '_'
|
|
265
|
+
lc = g.children.last
|
|
266
|
+
llg[1] = lc.last_line if lc }
|
|
267
|
+
end
|
|
238
268
|
end
|
|
239
269
|
|
|
240
270
|
class Node
|
|
@@ -348,6 +378,7 @@ module Probatio
|
|
|
348
378
|
|
|
349
379
|
f0 = f.last
|
|
350
380
|
f0[1] = (l == 0 ? f0[0] : l - 1) if f0
|
|
381
|
+
# sets the last line of the previous node...
|
|
351
382
|
|
|
352
383
|
f << [ l, 0, self ]
|
|
353
384
|
end
|
|
@@ -582,6 +613,8 @@ module Probatio
|
|
|
582
613
|
|
|
583
614
|
def test(name, opts={}, &block)
|
|
584
615
|
|
|
616
|
+
opts[:pending] = true if block.nil?
|
|
617
|
+
|
|
585
618
|
@children << Probatio::Test.new(self, @path, name.to_s, opts, block)
|
|
586
619
|
end
|
|
587
620
|
end
|
|
@@ -660,10 +693,8 @@ module Probatio
|
|
|
660
693
|
|
|
661
694
|
def path_and_line_match?(fpath, fline)
|
|
662
695
|
|
|
663
|
-
|
|
664
|
-
line &&
|
|
665
|
-
path == fpath &&
|
|
666
|
-
fline >= line && fline <= last_line
|
|
696
|
+
path == fpath &&
|
|
697
|
+
fline && line && fline >= line && fline <= last_line
|
|
667
698
|
end
|
|
668
699
|
|
|
669
700
|
def in_setup?
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: probatio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Mettraux
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: stringio
|