From 7f77a774f59279a0cd1b85c8a019a51aca6291bb Mon Sep 17 00:00:00 2001 From: BynariStar Date: Mon, 13 Nov 2017 01:19:30 +0200 Subject: [PATCH] Add test case order validation (#156) * Add test case order validation * Update variable names * Change validation error phrasing * Fix misplaced code * Change to ascending order * Apply requested changes --- validation/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/validation/app.js b/validation/app.js index b9ae9a5..a4cf8a8 100644 --- a/validation/app.js +++ b/validation/app.js @@ -252,6 +252,14 @@ function validateTOML(path) { validateNotEmpty(testcase, "gpu"); validateNotEmpty(testcase, "os"); }); + + // Validate dates are properly ordered + section.reduce(function(previousValue, currentValue) { + if (typeof previousValue === "undefined" || previousValue.date <= currentValue.date) { + return currentValue; + } + validationError("Test case dates are not properly sorted in ascending order."); + }); } /* else { validationError("No testcases.")