logic 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 397f970e699d515bdde7d8e1de8c721fcd653ae4
4
+ data.tar.gz: 9b13c676f0606347dea178edee118b0367df33db
5
+ SHA512:
6
+ metadata.gz: 83fb66a1bcada7c6e4fcc26567ae367c8e429b0d4f39775fd5296ab2736c64c77cca0927fb2140e61f58e2aa5e431e9d63706c06c43e96498be40f10f54d2aae
7
+ data.tar.gz: 3f1d5980bff682648e9fb2b6dc28fb7e395ef92b31544d57add4c8098de5a477e662d097b2994011b60a03547677cdb9c2a44b7a457d96e0f5e3c504b44a74a5
data/bin/logic CHANGED
@@ -10,8 +10,8 @@ require 'logic_operations'
10
10
  options = {
11
11
  :truth_table => true,
12
12
  :mcdc_pairs => true
13
- }
14
-
13
+ }
14
+
15
15
  option_parser = OptionParser.new
16
16
 
17
17
  option_parser.banner = "Usage: logic [options] <decision>"
@@ -23,7 +23,7 @@ end
23
23
 
24
24
  module Condition
25
25
  include Decision
26
-
26
+
27
27
  def condition_identifiers
28
28
  [text_value]
29
29
  end
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  module BinaryDecision
37
37
  include Decision
38
-
38
+
39
39
  def condition_identifiers
40
40
  elements.map(&:condition_identifiers).flatten
41
41
  end
@@ -49,7 +49,7 @@ end
49
49
 
50
50
  module Negation
51
51
  include Decision
52
-
52
+
53
53
  def condition_identifiers
54
54
  operand.condition_identifiers
55
55
  end
@@ -5,8 +5,8 @@ grammar Logic
5
5
  end
6
6
 
7
7
  rule binary_decision
8
- operand_1:unary_decision space
9
- operator space
8
+ operand_1:unary_decision space
9
+ operator space
10
10
  operand_2:decision <BinaryDecision>
11
11
  end
12
12
 
@@ -15,6 +15,7 @@ grammar Logic
15
15
  end
16
16
 
17
17
  rule negation
18
+ space?
18
19
  'not' space operand:unary_decision <Negation>
19
20
  end
20
21
 
@@ -23,19 +24,19 @@ grammar Logic
23
24
  end
24
25
 
25
26
  rule parenthesized
26
- '(' contents:decision ')' <Parenthesized>
27
+ '(' space? contents:decision space? ')' <Parenthesized>
27
28
  end
28
29
 
29
30
  rule operator
30
31
  'and' <And>
31
- /
32
+ /
32
33
  'or' <Or>
33
- /
34
+ /
34
35
  'xor' <Xor>
35
36
  end
36
37
 
37
38
  rule space
38
39
  [ \t\n\r]+
39
40
  end
40
-
41
+
41
42
  end
@@ -42,15 +42,15 @@ describe LogicParser, :parsing do
42
42
  end
43
43
  end
44
44
 
45
- { 'Hello' =>
45
+ { 'condition' =>
46
46
  { [0] => 0,
47
47
  [1] => 1
48
48
  },
49
- '(Hello)' =>
49
+ '(condition)' =>
50
50
  { [0] => 0,
51
51
  [1] => 1
52
52
  },
53
- 'not Hello' =>
53
+ ' not negated' =>
54
54
  { [0] => 1,
55
55
  [1] => 0
56
56
  },
@@ -89,6 +89,12 @@ describe LogicParser, :parsing do
89
89
  [0, 0, 1] => 1
90
90
  },
91
91
  'A and (B or C)' =>
92
+ { [1, 0, 0] => 0,
93
+ [1, 1, 0] => 1,
94
+ [1, 0, 1] => 1,
95
+ [0, 1, 1] => 0
96
+ },
97
+ '( A and (B or C) )' =>
92
98
  { [1, 0, 0] => 0,
93
99
  [1, 1, 0] => 1,
94
100
  [1, 0, 1] => 1,
metadata CHANGED
@@ -1,60 +1,55 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: logic
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 2
9
- version: 0.1.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Bryan Ash
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2010-05-27 00:00:00 -04:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: treetop
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
25
17
  - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 1
29
- - 4
30
- - 2
18
+ - !ruby/object:Gem::Version
31
19
  version: 1.4.2
32
20
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: polyglot
36
21
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.4.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: polyglot
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
39
31
  - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- - 2
44
- - 9
32
+ - !ruby/object:Gem::Version
45
33
  version: 0.2.9
46
34
  type: :runtime
47
- version_requirements: *id002
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.2.9
48
41
  description: Produces truth table and MC/DC test case pairs from parsed logic statement
49
- email: ""
50
- executables:
42
+ email: ''
43
+ executables:
51
44
  - logic
52
45
  extensions: []
53
-
54
- extra_rdoc_files:
46
+ extra_rdoc_files:
47
+ - LICENSE
48
+ - README.rdoc
49
+ files:
55
50
  - LICENSE
56
51
  - README.rdoc
57
- files:
52
+ - bin/logic
58
53
  - lib/array.rb
59
54
  - lib/integer.rb
60
55
  - lib/logic_operations.rb
@@ -64,41 +59,31 @@ files:
64
59
  - lib/test_case.rb
65
60
  - lib/test_case_set.rb
66
61
  - lib/truth_table.rb
67
- - bin/logic
68
62
  - spec/logic_parser_spec.rb
69
63
  - spec/spec.opts
70
64
  - spec/test_case_set_spec.rb
71
- - LICENSE
72
- - README.rdoc
73
- has_rdoc: true
74
65
  homepage:
75
66
  licenses: []
76
-
67
+ metadata: {}
77
68
  post_install_message:
78
- rdoc_options:
79
- - --charset=UTF-8
80
- require_paths:
69
+ rdoc_options:
70
+ - "--charset=UTF-8"
71
+ require_paths:
81
72
  - lib
82
- required_ruby_version: !ruby/object:Gem::Requirement
83
- requirements:
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
84
75
  - - ">="
85
- - !ruby/object:Gem::Version
86
- segments:
87
- - 0
88
- version: "0"
89
- required_rubygems_version: !ruby/object:Gem::Requirement
90
- requirements:
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
91
80
  - - ">="
92
- - !ruby/object:Gem::Version
93
- segments:
94
- - 0
95
- version: "0"
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
96
83
  requirements: []
97
-
98
84
  rubyforge_project:
99
- rubygems_version: 1.3.6
85
+ rubygems_version: 2.2.2
100
86
  signing_key:
101
- specification_version: 3
87
+ specification_version: 4
102
88
  summary: Taking the pain out of MC/DC testing
103
89
  test_files: []
104
-