<commit_before>var cp = require("child_process");
var endOfLine = require('os').EOL;

process.on('message', function (message) {
    var exeFilePath = message.exeFilePath;
    var testCases = message.prob.testCases;
    var tcTotalExecuted = 0;
    var jsonOutput = [];
    testCases.forEach(
            function executeTestCase(testCase) {
                var proc = cp.exec(exeFilePath, { killSignal: 'SIGKILL', timeout: "10000" }, function (error, stdout, stderr) {
                    if (error) {
                        jsonOutput.push({
                            testCase: testCase,
                            result: "Failed",
                            actualOutput: "TIME_LIMIT_EXCEEDED"
                        });

                    } else if (stderr !== "") {
                        jsonOutput.push({
                            testCase: testCase,
                            result: "Failed",
                            actualOutput: "STDERR" + stderr
                        });

                    } else {
                        if (stdout === testCase.expectedOutput) {
                            jsonOutput.push({
                                testCase: testCase,
                                actualOutput: stdout,
                                result: "Passed"
                            });
                        }
                        else {
                            jsonOutput.push({<commit_msg>String comparison in output - Skipping newline and spaces and casing.<commit_after>var cp = require("child_process");
var endOfLine = require('os').EOL;
function matchStrings(str1, str2)
{
	str1 = str1.trim();
	str2 = str2.trim();
	return (str1.toUpperCase()==str2.toUpperCase());
}
process.on('message', function (message) {
    var exeFilePath = message.exeFilePath;
    var testCases = message.prob.testCases;
    var tcTotalExecuted = 0;
    var jsonOutput = [];
    testCases.forEach(
            function executeTestCase(testCase) {
                var proc = cp.exec(exeFilePath, { killSignal: 'SIGKILL', timeout: "10000" }, function (error, stdout, stderr) {
                    if (error) {
                        jsonOutput.push({
                            testCase: testCase,
                            result: "Failed",
                            actualOutput: "TIME_LIMIT_EXCEEDED"
                        });

                    } else if (stderr !== "") {
                        jsonOutput.push({
                            testCase: testCase,
                            result: "Failed",
                            actualOutput: "STDERR" + stderr
                        });

                    } else {
                        if (matchStrings(stdout,testCase.expectedOutput)) {
                            jsonOutput.push({
                                testCase: testCase,
                                actualOutput: stdout,
                                result: "Passed"
                            });
                        }
                        else {
                            jsonOutput.push({
{'fraction_non_alphanumeric': 0.09388151505341534, 'fraction_numerical': 0.006474587245063127, 'mean_word_length': 1.0655080213903743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4077791', 'n_tokens_mistral': 748, 'n_tokens_neox': 702, 'n_words': 150}