gcovtools 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/line.rb +1 -0
- data/lib/version.rb +1 -1
- data/spec/gcovtools/line_spec.rb +27 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ff206b6aa6e1b572ba0c6132b07b98ec02dfc9e
|
4
|
+
data.tar.gz: 5ae22b704552ed6a1e3b8bc12fe26dab8c753257
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f10851c0e8c054459c838b002fc98cd42c381b67415d14aaeab2bf434f7d5952ae56feebfe00644f1ad5dfdcad0914c6648a58b2e6574a603caf431ad703fe3
|
7
|
+
data.tar.gz: 71f141bd8affacf8a8233cc4212f44a80d8e9c4c47725645822fc621e824fad7a42a9df6eb63cf9d7f92b3b39716ccf3e24b1796921c7f1c5fc5e460412de6e2
|
data/lib/line.rb
CHANGED
data/lib/version.rb
CHANGED
data/spec/gcovtools/line_spec.rb
CHANGED
@@ -2,46 +2,65 @@ require_relative '../spec_helper'
|
|
2
2
|
|
3
3
|
describe GCOVTOOLS::Line do
|
4
4
|
describe "#number" do
|
5
|
-
it "
|
5
|
+
it "should return the number it was given" do
|
6
6
|
line = GCOVTOOLS::Line.new 2, 4, "abcdef"
|
7
7
|
expect(line.number).to eq(2)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
describe "#count" do
|
12
|
-
it "
|
12
|
+
it "should return the count it was given" do
|
13
13
|
line = GCOVTOOLS::Line.new 2, 4, "abcdef"
|
14
14
|
expect(line.count).to eq(4)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
describe "#text" do
|
19
|
-
it "
|
19
|
+
it "should return the text it was given" do
|
20
20
|
line = GCOVTOOLS::Line.new 2, 4, "abcdef"
|
21
21
|
expect(line.text).to eq("abcdef")
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe ".parse" do
|
26
|
-
it "
|
26
|
+
it "should parse gcov format line with count" do
|
27
27
|
line = GCOVTOOLS::Line.parse " 2: 55: std::string StringUtil::ltrim( const std::string &s ) "
|
28
28
|
expect(line.number).to eq(55)
|
29
29
|
expect(line.count).to eq(2)
|
30
30
|
expect(line.text).to eq(" std::string StringUtil::ltrim( const std::string &s ) ")
|
31
31
|
end
|
32
32
|
|
33
|
-
it "
|
33
|
+
it "should parse empty gcov format line" do
|
34
34
|
line = GCOVTOOLS::Line.parse " -: 35: * don't worry about excessive copying."
|
35
35
|
expect(line.number).to eq(35)
|
36
36
|
expect(line.count).to eq(:none)
|
37
37
|
expect(line.text).to eq(" * don't worry about excessive copying.")
|
38
38
|
end
|
39
39
|
|
40
|
-
it "
|
41
|
-
line = GCOVTOOLS::Line.parse " #####: 89: } "
|
40
|
+
it "should parse missed gcov format line" do
|
41
|
+
line = GCOVTOOLS::Line.parse " #####: 89: int somestatement = /*ignored value*/ xyz; } "
|
42
42
|
expect(line.number).to eq(89)
|
43
43
|
expect(line.count).to eq(:missed)
|
44
|
-
expect(line.text).to eq(" } ")
|
44
|
+
expect(line.text).to eq(" int somestatement = /*ignored value*/ xyz; } ")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should ignore missed closing brace" do
|
48
|
+
line = GCOVTOOLS::Line.parse " #####: 1:}"
|
49
|
+
expect(line.number).to eq(1)
|
50
|
+
expect(line.count).to eq(:none)
|
51
|
+
expect(line.text).to eq("}")
|
52
|
+
line = GCOVTOOLS::Line.parse " #####: 89: } "
|
53
|
+
expect(line.number).to eq(89)
|
54
|
+
expect(line.count).to eq(:none)
|
55
|
+
expect(line.text).to eq(" } ")
|
56
|
+
line = GCOVTOOLS::Line.parse " #####: 999: }"
|
57
|
+
expect(line.number).to eq(999)
|
58
|
+
expect(line.count).to eq(:none)
|
59
|
+
expect(line.text).to eq(" }")
|
60
|
+
line = GCOVTOOLS::Line.parse " #####: 5:} "
|
61
|
+
expect(line.number).to eq(5)
|
62
|
+
expect(line.count).to eq(:none)
|
63
|
+
expect(line.text).to eq("} ")
|
45
64
|
end
|
46
65
|
|
47
66
|
end
|