createRatios method

void createRatios()

Calculate ratios as well as maximum widths for all columns if needed

Implementation

void createRatios() {
  final testCount = tests.length;

  if (testCount <= 0) {
    return;
  }

  final isRaw = format.isRaw;

  // Collect all single test ratios and calculate max widths
  //
  final test1 = tests[0];
  maxNameWidth = 0;

  for (var i = 0, width = 0; i < testCount; i++) {
    final test2 = tests[i];

    test2.setRatio(test1);

    if (!isRaw) {
      width = test2.name.length;
      maxNameWidth = (maxNameWidth >= width ? maxNameWidth : width);

      width = test2.outValue.length;
      maxValueWidth = (maxValueWidth >= width ? maxValueWidth : width);

      width = test2.outRatio.length;
      maxRatioWidth = (maxRatioWidth >= width ? maxRatioWidth : width);
    }
  }
}