atp 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/lib/atp/ast/builder.rb +14 -4
- data/lib/atp/formatters/datalog.rb +2 -2
- data/lib/atp/processors/marshal.rb +10 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8486776ce5c49ed49887188d3368b6b8c8b14547
|
4
|
+
data.tar.gz: e4c8f89a29f55be26629b87896a8e41d405edb92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78b3e52cdbaccf58d4cd1e66557a8f2f093122a51d3af07212ddcc5e6d3d4a10792c98bad8bb31e7810c286654de81107ebcba5658564641fe9fdbbb18d79154
|
7
|
+
data.tar.gz: 7473fe3cc9a7d668733ab61ce33af26034bd8c51a53668ace3b246cd14c921fafd55f686a17bae370914ab586b3cdb2592341ee9c6cddabda0ee31f3fd3d579b
|
data/config/version.rb
CHANGED
data/lib/atp/ast/builder.rb
CHANGED
@@ -197,12 +197,22 @@ module ATP
|
|
197
197
|
def test(object, options = {})
|
198
198
|
children = [n(:object, object)]
|
199
199
|
|
200
|
-
|
201
|
-
|
200
|
+
n = (options[:name] || options[:tname] || options[:test_name])
|
201
|
+
unless n
|
202
|
+
[:name, :tname, :test_name].each do |m|
|
203
|
+
n ||= object.respond_to?(m) ? object.send(m) : nil
|
204
|
+
end
|
202
205
|
end
|
203
|
-
|
204
|
-
|
206
|
+
children << name(n) if n
|
207
|
+
|
208
|
+
n = (options[:number] || options[:num] || options[:tnum] || options[:test_number])
|
209
|
+
unless n
|
210
|
+
[:number, :num, :tnum, :test_number].each do |m|
|
211
|
+
n ||= object.respond_to?(m) ? object.send(m) : nil
|
212
|
+
end
|
205
213
|
end
|
214
|
+
children << number(n) if n
|
215
|
+
|
206
216
|
children << id(options[:id].to_s.downcase.to_sym) if options[:id]
|
207
217
|
|
208
218
|
children << on_fail(options[:on_fail]) if options[:on_fail]
|
@@ -8,7 +8,7 @@ module ATP
|
|
8
8
|
str = 'Number'.ljust(15)
|
9
9
|
str += 'Result'.ljust(9)
|
10
10
|
str += 'Name'.ljust(55)
|
11
|
-
str += '
|
11
|
+
str += 'Pattern'.ljust(55)
|
12
12
|
str += 'ID'
|
13
13
|
puts str
|
14
14
|
process_all(node.children)
|
@@ -27,7 +27,7 @@ module ATP
|
|
27
27
|
name = node.find(:object).value['Test']
|
28
28
|
end
|
29
29
|
str += "#{name}".ljust(55)
|
30
|
-
str += "#{node.find(:object).value['
|
30
|
+
str += "#{node.find(:object).value['Pattern']}".ljust(55)
|
31
31
|
str += "#{node.find(:id).value}"
|
32
32
|
puts str
|
33
33
|
end
|
@@ -3,12 +3,17 @@ module ATP
|
|
3
3
|
# Makes the AST safe for Marshaling
|
4
4
|
class Marshal < Processor
|
5
5
|
def on_object(node)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
o = node.value
|
7
|
+
if o.is_a?(String)
|
8
|
+
node.updated(nil, [{ 'Test' => o }])
|
9
|
+
elsif o.is_a?(Hash)
|
10
|
+
node.updated(nil, [o])
|
11
|
+
elsif o.respond_to?(:to_meta) && o.to_meta && !o.to_meta.empty?
|
12
|
+
node.updated(nil, [o.to_meta])
|
10
13
|
else
|
11
|
-
|
14
|
+
meta = { 'Test' => o.name }
|
15
|
+
meta['Pattern'] = o.try(:pattern)
|
16
|
+
node.updated(nil, [meta])
|
12
17
|
end
|
13
18
|
end
|
14
19
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|