Browse Source

Removed obvious typings

main
Cédric Belin 4 weeks ago
parent
commit
ff1051173f
18 changed files with 20 additions and 20 deletions
  1. +2
    -2
      example/main.hx
  2. +1
    -1
      src/lcov/BranchCoverage.hx
  3. +1
    -1
      src/lcov/BranchData.hx
  4. +1
    -1
      src/lcov/FunctionCoverage.hx
  5. +1
    -1
      src/lcov/FunctionData.hx
  6. +1
    -1
      src/lcov/LcovException.hx
  7. +1
    -1
      src/lcov/LineCoverage.hx
  8. +1
    -1
      src/lcov/LineData.hx
  9. +1
    -1
      src/lcov/Report.hx
  10. +1
    -1
      test/TestAll.hx
  11. +1
    -1
      test/lcov/BranchCoverageTest.hx
  12. +1
    -1
      test/lcov/BranchDataTest.hx
  13. +1
    -1
      test/lcov/FunctionCoverageTest.hx
  14. +1
    -1
      test/lcov/FunctionDataTest.hx
  15. +1
    -1
      test/lcov/LineCoverageTest.hx
  16. +1
    -1
      test/lcov/LineDataTest.hx
  17. +1
    -1
      test/lcov/RecordTest.hx
  18. +2
    -2
      test/lcov/ReportTest.hx

+ 2
- 2
example/main.hx View File

@@ -6,7 +6,7 @@ import sys.io.File;
class Example {

/** Formats coverage data as LCOV report. **/
public function formatReport(): Void {
public function formatReport() {
final lineCoverage = new LineCoverage(2, 2, [
new LineData(6, 2, "PF4Rz2r7RTliO9u6bZ7h6g"),
new LineData(7, 2, "yGMB6FhEEAd8OyASe3Ni1w")
@@ -22,7 +22,7 @@ class Example {
}

/** Parses a LCOV report to coverage data. **/
public function parseReport(): Void {
public function parseReport() {
try {
final coverage = File.getContent("/path/to/lcov.info");
final report = Report.fromCoverage(coverage);


+ 1
- 1
src/lcov/BranchCoverage.hx View File

@@ -17,7 +17,7 @@ import php.NativeIndexedArray;
public var hit: Int;

/** Creates a new branch coverage. **/
public function new(found: Int = 0, hit: Int = 0, ?data: #if php NativeIndexedArray<BranchData> #else Array<BranchData> #end) {
public function new(found = 0, hit = 0, ?data: #if php NativeIndexedArray<BranchData> #else Array<BranchData> #end) {
this.data = data != null ? data : [];
this.found = found;
this.hit = hit;


+ 1
- 1
src/lcov/BranchData.hx View File

@@ -16,7 +16,7 @@ package lcov;
public var taken: Int;

/** Creates a new branch data. **/
public function new(lineNumber: Int, blockNumber: Int, branchNumber: Int, taken: Int = 0) {
public function new(lineNumber: Int, blockNumber: Int, branchNumber: Int, taken = 0) {
this.blockNumber = blockNumber;
this.branchNumber = branchNumber;
this.lineNumber = lineNumber;


+ 1
- 1
src/lcov/FunctionCoverage.hx View File

@@ -17,7 +17,7 @@ import php.NativeIndexedArray;
public var hit: Int;

/** Creates a new function coverage. **/
public function new(found: Int = 0, hit: Int = 0, ?data: #if php NativeIndexedArray<FunctionData> #else Array<FunctionData> #end) {
public function new(found = 0, hit = 0, ?data: #if php NativeIndexedArray<FunctionData> #else Array<FunctionData> #end) {
this.data = data != null ? data : [];
this.found = found;
this.hit = hit;


+ 1
- 1
src/lcov/FunctionData.hx View File

@@ -13,7 +13,7 @@ package lcov;
public var lineNumber: Int;

/** Creates a new function data. **/
public function new(functionName: String, lineNumber: Int, executionCount: Int = 0) {
public function new(functionName: String, lineNumber: Int, executionCount = 0) {
this.executionCount = executionCount;
this.functionName = functionName;
this.lineNumber = lineNumber;


+ 1
- 1
src/lcov/LcovException.hx View File

@@ -12,7 +12,7 @@ import haxe.Exception;
public final source: String;

/** Creates a new LCOV exception. **/
public function new(message: String = "", source: String = "", offset: Int = 0, ?previous: Exception) {
public function new(message = "", source = "", offset = 0, ?previous: Exception) {
super(message, previous);
this.offset = offset;
this.source = source;


+ 1
- 1
src/lcov/LineCoverage.hx View File

@@ -17,7 +17,7 @@ import php.NativeIndexedArray;
public var hit: Int;

/** Creates a new line coverage. **/
public function new(found: Int = 0, hit: Int = 0, ?data: #if php NativeIndexedArray<LineData> #else Array<LineData> #end) {
public function new(found = 0, hit = 0, ?data: #if php NativeIndexedArray<LineData> #else Array<LineData> #end) {
this.data = data != null ? data : [];
this.found = found;
this.hit = hit;


+ 1
- 1
src/lcov/LineData.hx View File

@@ -13,7 +13,7 @@ package lcov;
public var lineNumber: Int;

/** Creates a new line data. **/
public function new(lineNumber: Int, executionCount: Int = 0, checksum: String = "") {
public function new(lineNumber: Int, executionCount = 0, checksum = "") {
this.checksum = checksum;
this.executionCount = executionCount;
this.lineNumber = lineNumber;


+ 1
- 1
src/lcov/Report.hx View File

@@ -16,7 +16,7 @@ using StringTools;
public var testName: String;

/** Creates a new report. **/
public function new(testName: String = "", ?records: #if php NativeIndexedArray<Record> #else Array<Record> #end) {
public function new(testName = "", ?records: #if php NativeIndexedArray<Record> #else Array<Record> #end) {
this.records = records != null ? records : [];
this.testName = testName;
}


+ 1
- 1
test/TestAll.hx View File

@@ -20,7 +20,7 @@ class TestAll {
];

/** Application entry point. **/
static function main(): Void {
static function main() {
final runner = new Runner();
runner.onComplete.add(_ -> {
final logger = MCoverage.getLogger();


+ 1
- 1
test/lcov/BranchCoverageTest.hx View File

@@ -4,7 +4,7 @@ package lcov;
class BranchCoverageTest extends Test {

/** Tests the `toString()` method. **/
function testToString(): Void {
function testToString() {
// It should return a format like "BRF:<found>\nBRH:<hit>".
final data = new BranchData(127, 3, 2, 1);
Assert.equals("BRF:0\nBRH:0", new BranchCoverage().toString());


+ 1
- 1
test/lcov/BranchDataTest.hx View File

@@ -4,7 +4,7 @@ package lcov;
class BranchDataTest extends Test {

/** Tests the `toString()` method. **/
function testToString(): Void {
function testToString() {
// It should return a format like "BRDA:<lineNumber>,<blockNumber>,<branchNumber>,<taken>".
Assert.equals("BRDA:0,0,0,-", new BranchData(0, 0, 0).toString());
Assert.equals("BRDA:127,3,2,1", new BranchData(127, 3, 2, 1).toString());


+ 1
- 1
test/lcov/FunctionCoverageTest.hx View File

@@ -4,7 +4,7 @@ package lcov;
class FunctionCoverageTest extends Test {

/** Tests the `toString()` method. **/
function testToString(): Void {
function testToString() {
// It should return a format like "FNF:<found>\nFNH:<hit>".
final coverage = new FunctionCoverage(23, 11, [new FunctionData("main", 127, 3)]);
Assert.equals("FNF:0\nFNH:0", new FunctionCoverage().toString());


+ 1
- 1
test/lcov/FunctionDataTest.hx View File

@@ -4,7 +4,7 @@ package lcov;
class FunctionDataTest extends Test {

/** Tests the `toString()` method. **/
function testToString(): Void {
function testToString() {
// It should return a format like "FN:<lineNumber>,<functionName>" when used as definition.
Assert.equals("FN:0,", new FunctionData("", 0).toString(true));
Assert.equals("FN:127,main", new FunctionData("main", 127, 3).toString(true));


+ 1
- 1
test/lcov/LineCoverageTest.hx View File

@@ -4,7 +4,7 @@ package lcov;
class LineCoverageTest extends Test {

/** Tests the `toString()` method. **/
function testToString(): Void {
function testToString() {
// It should return a format like "LF:<found>\nLH:<hit>".
final data = new LineData(127, 3);
Assert.equals("LF:0\nLH:0", new LineCoverage().toString());


+ 1
- 1
test/lcov/LineDataTest.hx View File

@@ -4,7 +4,7 @@ package lcov;
class LineDataTest extends Test {

/** Tests the `toString()` method. **/
function testToString(): Void {
function testToString() {
// It should return a format like "DA:<lineNumber>,<executionCount>[,<checksum>]".
Assert.equals("DA:0,0", new LineData(0).toString());
Assert.equals("DA:127,3,ed076287532e86365e841e92bfc50d8c", new LineData(127, 3, "ed076287532e86365e841e92bfc50d8c").toString());


+ 1
- 1
test/lcov/RecordTest.hx View File

@@ -4,7 +4,7 @@ package lcov;
class RecordTest extends Test {

/** Tests the `toString()` method. **/
function testToString(): Void {
function testToString() {
// It should return a format like "SF:<sourceFile>\nend_of_record".
final record = new Record("/home/cedx/lcov.hx", {
branches: new BranchCoverage(),


+ 2
- 2
test/lcov/ReportTest.hx View File

@@ -6,7 +6,7 @@ import sys.io.File;
class ReportTest extends Test {

/** Tests the `fromCoverage()` method. **/
function testFromCoverage(): Void {
function testFromCoverage() {
final report = Report.fromCoverage(File.getContent("test/fixtures/lcov.info"));

// It should have a test name.
@@ -54,7 +54,7 @@ class ReportTest extends Test {
}

/** Tests the `toString()` method. **/
function testToString(): Void {
function testToString() {
// It should return a format like "TN:<testName>".
final record = new Record("");
Assert.equals(0, new Report().toString().length);


Loading…
Cancel
Save