Browse Source

Fix typos

Marcelo Fornet 5 years ago
parent
commit
5b78d4581a
6 changed files with 51 additions and 51 deletions
  1. 9 9
      README.md
  2. 18 18
      src/core.ts
  3. 7 7
      src/extension.ts
  4. 10 10
      src/test/extension.test.ts
  5. 5 5
      src/types.ts
  6. 2 2
      todo.md

+ 9 - 9
README.md

@@ -7,7 +7,7 @@
 * Contest/Problem parsing. (Through [Competitive-Companion](https://github.com/jmerle/competitive-companion) extension).
 * Running solution against testcases automatically.
 * Add custom testcases easily.
-* Veredict reporting (OK, WA, RTE, TLE, CE).
+* Verdict reporting (OK, WA, RTE, TLE, CE).
 * Smart generator creation. Testcases generator is created using `tcgen` program synthesis tool by inspecting testcases.
 * Stressing solution against brute using a generator (Useful to find corner cases).
 
@@ -29,7 +29,7 @@ We have a group to discuss about this tool in Telegram. [Join here](https://t.me
 
 * Add more testcases than provided in statement using `Add Test Case`, or modify and see existing testcases by calling `Open Test Case`.
 
-* If your solution keep failing you can stress it using a generator and a brute solution. Call `Upgrage` to create both generator (`gen.py`) and correct (`brute.cpp`) programs. Right now generator must be written in python. After both codes are ready call `Stress` and your original code will be tested on random test cases from generator against correct solution.
+* If your solution keep failing you can stress it using a generator and a brute solution. Call `Upgrade` to create both generator (`gen.py`) and correct (`brute.cpp`) programs. Right now generator must be written in python. After both codes are ready call `Stress` and your original code will be tested on random test cases from generator against correct solution.
 
 The environment structure is the following:
 
@@ -51,7 +51,7 @@ The environment structure is the following:
         E/...
 ```
 
-Certainly **acmX** can be (and hopefully will be) extended so that it fits everyones pipeline. If **acmX** almost fit yours, feel free to improve it and make a PR! I'll be happy to hear from you and give you support. If you find any issue report it at [github issue tracker](https://github.com/mfornet/acmx/issues).
+Certainly **acmX** can be (and hopefully will be) extended so that it fits everyone pipeline. If **acmX** almost fit yours, feel free to improve it and make a PR! I'll be happy to hear from you and give you support. If you find any issue report it at [github issue tracker](https://github.com/mfornet/acmx/issues).
 
 ## Getting started
 
@@ -72,7 +72,7 @@ I encourage everyone to read and change [all settings](#settings) before first u
 
 ## How does stressing the solution work
 
-To stress the solution your code is compared to a correct code against a large sample of testcases. In order to do that you should execute `ACMX: Upgrade` from the command pallete. Two files will be created.
+To stress the solution your code is compared to a correct code against a large sample of testcases. In order to do that you should execute `ACMX: Upgrade` from the command palette. Two files will be created.
 
 * `brute.cpp` This should be a correct solution. A code that is expected to report correct output. It doesn't matter if it's slow as long as you only check this program against small testcases.
 * `gen.py` Every time this code is executed is expected to print a random testcases.
@@ -92,21 +92,21 @@ Yes, of course, and any other language you want. Just make sure to update your [
 
 ## This problem has multiple correct answers, what can I do
 
-Set checker properly for this problemm via **ACMX: Set Checker**. Checkers can use [testlib.h](https://github.com/MikeMirzayanov/testlib) which is recommended.
+Set checker properly for this problem via **ACMX: Set Checker**. Checkers can use [testlib.h](https://github.com/MikeMirzayanov/testlib) which is recommended.
 
 ## Commands
 
-Call this commands from the command pallete (`Ctrl + Shift + P`).
+Call this commands from the command palette (`Ctrl + Shift + P`).
 
 * acmx.addProblem (**ACMX: New Problem**): Create a new problem. Make environment skeleton and download testcases.
 * acmx.addContest (**ACMX: New Contest**): Create a new contest. Make environment skeleton and download testcases.
 * acmx.runSolution (**ACMX: Run**): Compile and run current solution against testcases.
-* acmx.openTestcase (**ACMX: Open Test Case**): Open a paticular testcase.
+* acmx.openTestcase (**ACMX: Open Test Case**): Open a particular testcase.
 * acmx.addTestcase (**ACMX: Add Test Case**): Add a new testcase.
 * acmx.coding (**ACMX: View: Code**): Return to 1 column layout (better to code).
 * acmx.stress (**ACMX: Stress**): Run the solution against correct program using testcases from generator. Useful to find failing and corner cases. Must call upgrade first.
 * acmx.setChecker (**ACMX: Set Checker**): Create checker file. Allow to select a checker among a pool of custom checkers.
-* acmx.upgrade (**ACMX: Upgrade**): Create aditionals files before calling `Stress`.
+* acmx.upgrade (**ACMX: Upgrade**): Create additional files before calling `Stress`.
 * acmx.compile (**ACMX: Compile**): Compile `sol.cpp`.
 
 ## Settings
@@ -114,7 +114,7 @@ Call this commands from the command pallete (`Ctrl + Shift + P`).
 * **acmx.configuration.templatePath**: Path to template file. Leave empty to use default template.
 * **acmx.configuration.solutionPath**: Path to folder where contest will be created and stored. To set active workspace use `.`
 * **acmx.configuration.extension**: Extension of the programming language you will use to code solutions. Default `cpp` for c++
-* **acmx.run.timetimeLimit**: Maximum time limit in seconds to run the program on each test case.
+* **acmx.run.timeLimit**: Maximum time limit in seconds to run the program on each test case.
 * **acmx.execution.compile**: Command to compile C++ programs. Refer to the code as $PROGRAM, and output file as $OUTPUT.
 * **acmx.execution.pythonPath**: Path to python executable. This will be used to run generator.
 * **acmx.stress.times**: Number of times to run solution on random generated test cases against

+ 18 - 18
src/core.ts

@@ -4,7 +4,7 @@ import { mkdirSync, existsSync, copyFileSync, openSync, readSync, readdirSync, w
 import { dirname, join, extname, basename } from "path";
 import * as child_process from 'child_process';
 import * as gwen from './gwen';
-import { TestcaseResult, Veredict, SolutionResult, Problem, Contest, SiteDescription } from "./types";
+import { TestcaseResult, Verdict, SolutionResult, Problem, Contest, SiteDescription } from "./types";
 import { ceTerminal, stderrTerminal } from './terminal';
 const md5File = require('md5-file');
 
@@ -370,10 +370,10 @@ export function timedRun(path: string, tcName: string, timeout: number){
     // Check if an error happened
     if (xresult.status !== 0){
         if (spanTime < timeout){
-            return new TestcaseResult(Veredict.RTE);
+            return new TestcaseResult(Verdict.RTE);
         }
         else{
-            return new TestcaseResult(Veredict.TLE);
+            return new TestcaseResult(Verdict.TLE);
         }
     }
 
@@ -386,10 +386,10 @@ export function timedRun(path: string, tcName: string, timeout: number){
     let checker_result = child_process.spawnSync(checker_path, [tcInput, tcCurrent, tcOutput]);
 
     if (checker_result.status !== 0){
-        return new TestcaseResult(Veredict.WA);
+        return new TestcaseResult(Verdict.WA);
     }
     else{
-        return new TestcaseResult(Veredict.OK, spanTime);
+        return new TestcaseResult(Verdict.OK, spanTime);
     }
 }
 
@@ -465,7 +465,7 @@ export function testSolution(path: string){
     let testcasesId = testcasesName(path);
 
     if (testcasesId.length === 0){
-        return new SolutionResult(Veredict.NO_TESTCASES, undefined, undefined);
+        return new SolutionResult(Verdict.NO_TESTCASES, undefined, undefined);
     }
 
     // Proccess all testcases in sorted order
@@ -486,7 +486,7 @@ export function testSolution(path: string){
         // Run while there none have failed already
         if (fail === undefined){
             let tcResult = timedRun(path, tcId, getTimeout());
-            if (tcResult.status !== Veredict.OK){
+            if (tcResult.status !== Verdict.OK){
                 fail = new SolutionResult(tcResult.status, tcId);
             }
             results.push(tcResult);
@@ -501,7 +501,7 @@ export function testSolution(path: string){
             }
         }
 
-        return new SolutionResult(Veredict.OK, undefined, maxTime);
+        return new SolutionResult(Verdict.OK, undefined, maxTime);
     }
     else{
         return fail;
@@ -569,7 +569,7 @@ export function stressSolution(path: string, times: number){
         // Check sol report same result than brute
         let result = timedRun(path, 'gen', getTimeout());
 
-        if (result.status !== Veredict.OK){
+        if (result.status !== Verdict.OK){
             return new SolutionResult(result.status, 'gen');
         }
 
@@ -583,27 +583,27 @@ export function stressSolution(path: string, times: number){
         }
     }
 
-    return new SolutionResult(Veredict.OK, undefined, maxTime);
+    return new SolutionResult(Verdict.OK, undefined, maxTime);
 }
 
-export function veredictName(veredict: Veredict){
-    switch (veredict) {
-        case Veredict.OK:
+export function verdictName(verdict: Verdict){
+    switch (verdict) {
+        case Verdict.OK:
             return "OK";
 
-        case Veredict.WA:
+        case Verdict.WA:
             return "WA";
 
-        case Veredict.TLE:
+        case Verdict.TLE:
             return "TLE";
 
-        case Veredict.RTE:
+        case Verdict.RTE:
             return "RTE";
 
-        case Veredict.CE:
+        case Verdict.CE:
             return "CE";
 
         default:
-            throw new Error("Invalid Veredict");
+            throw new Error("Invalid Verdict");
     }
 }

+ 7 - 7
src/extension.ts

@@ -3,8 +3,8 @@ import * as vscode from 'vscode';
 import { existsSync, writeFileSync, readdirSync, copyFileSync } from 'fs';
 import { join, extname } from 'path';
 import { SITES, getSite } from './conn';
-import { newContestFromId, testSolution, veredictName, stressSolution, upgradeArena, newProblemFromId, removeExtension, solFile, initAcmX, currentProblem, compileCode, ATTIC, SRC } from './core';
-import { Veredict, SiteDescription } from './types';
+import { newContestFromId, testSolution, verdictName, stressSolution, upgradeArena, newProblemFromId, removeExtension, solFile, initAcmX, currentProblem, compileCode, ATTIC, SRC } from './core';
+import { Verdict, SiteDescription } from './types';
 import { startCompetitiveCompanionService } from './companion';
 import { hideTerminals } from './terminal';
 
@@ -126,14 +126,14 @@ async function runSolution(){
 
     let result = testSolution(path);
 
-    if (result.status === Veredict.OK){
+    if (result.status === Verdict.OK){
         vscode.window.showInformationMessage(`OK. Time ${result.maxTime!}ms`);
     }
-    else if (result.status === Veredict.NO_TESTCASES){
+    else if (result.status === Verdict.NO_TESTCASES){
         vscode.window.showErrorMessage(`No testcases.`);
     }
     else{
-        vscode.window.showErrorMessage(`${veredictName(result.status)} on test ${result.failTcId}`);
+        vscode.window.showErrorMessage(`${verdictName(result.status)} on test ${result.failTcId}`);
         debugTestcase(path, result.failTcId!);
     }
 }
@@ -257,11 +257,11 @@ async function stress(){
 
     let result = stressSolution(path, stressTimes);
 
-    if (result.status === Veredict.OK){
+    if (result.status === Verdict.OK){
         vscode.window.showInformationMessage(`OK. Time ${result.maxTime!}ms`);
     }
     else{
-        vscode.window.showErrorMessage(`${veredictName(result.status)} on test ${result.failTcId}`);
+        vscode.window.showErrorMessage(`${verdictName(result.status)} on test ${result.failTcId}`);
         debugTestcase(path, result.failTcId!);
     }
 }

+ 10 - 10
src/test/extension.test.ts

@@ -7,7 +7,7 @@
 import * as assert from 'assert';
 import { dirname, join } from 'path';
 import { timedRun, testcasesName, testSolution, newArena, ATTIC, TESTCASES, upgradeArena, stressSolution, newProblemFromId, newContestFromId, getTimeout } from '../core';
-import { TestcaseResult, Veredict } from '../types';
+import { TestcaseResult, Verdict } from '../types';
 import { rmdirSync, existsSync, readdirSync, unlinkSync, openSync, writeSync, closeSync } from 'fs';
 import { getSite, SITES, PERSONAL } from '../conn';
 
@@ -150,14 +150,14 @@ suite("Extension Tests", function () {
     /**
      * core::timedRun
      *
-     * Test running one single test cases, and receiving all different veredicts
+     * Test running one single test cases, and receiving all different verdicts
      */
     test("timedRunOk", function() {
         let exampleContest = join(ARENA, 'exampleContest');
         let problem = join(exampleContest, 'A');
         let testcaseId = '0';
         let result: TestcaseResult = timedRun(problem, testcaseId, getTimeout());
-        assert.equal(result.status, Veredict.OK);
+        assert.equal(result.status, Verdict.OK);
     });
 
     test("timedRunWA", function() {
@@ -165,7 +165,7 @@ suite("Extension Tests", function () {
         let problem = join(exampleContest, 'B');
         let testcaseId = '0';
         let result: TestcaseResult = timedRun(problem, testcaseId, getTimeout());
-        assert.equal(result.status, Veredict.WA);
+        assert.equal(result.status, Verdict.WA);
     });
 
     test("timedRunRTE", function() {
@@ -173,7 +173,7 @@ suite("Extension Tests", function () {
         let problem = join(exampleContest, 'C');
         let testcaseId = '0';
         let result: TestcaseResult = timedRun(problem, testcaseId, getTimeout());
-        assert.equal(result.status, Veredict.RTE);
+        assert.equal(result.status, Verdict.RTE);
     });
 
     test("timedRunTLE", function() {
@@ -181,19 +181,19 @@ suite("Extension Tests", function () {
         let problem = join(exampleContest, 'D');
         let testcaseId = '0';
         let result: TestcaseResult = timedRun(problem, testcaseId, 100);
-        assert.equal(result.status, Veredict.TLE);
+        assert.equal(result.status, Verdict.TLE);
     });
 
     /**
      * core::testSolution
      *
-     * Test running one single test cases, and receiving all different veredicts
+     * Test running one single test cases, and receiving all different verdicts
      */
     test("testSolutionOK", function() {
         let exampleContest = join(ARENA, 'exampleContest');
         let problem = join(exampleContest, 'A');
         let result: TestcaseResult = testSolution(problem);
-        assert.equal(result.status, Veredict.OK);
+        assert.equal(result.status, Verdict.OK);
     });
 
     test("testSolutionCE", function() {
@@ -256,7 +256,7 @@ suite("Extension Tests", function () {
 
         let result = stressSolution(path, 10);
 
-        assert.equal(result.status, Veredict.OK);
+        assert.equal(result.status, Verdict.OK);
 
         recRmdir(path);
     });
@@ -307,7 +307,7 @@ suite("Extension Tests", function () {
 
         let result = stressSolution(path, 10);
 
-        assert.equal(result.status, Veredict.WA);
+        assert.equal(result.status, Verdict.WA);
 
         recRmdir(path);
     });

+ 5 - 5
src/types.ts

@@ -1,4 +1,4 @@
-export enum Veredict{
+export enum Verdict{
     OK,     // Accepted
     WA,     // Wrong Answer
     TLE,    // Time Limit Exceeded
@@ -8,21 +8,21 @@ export enum Veredict{
 }
 
 export class TestcaseResult{
-    status: Veredict;
+    status: Verdict;
     spanTime?: number;
 
-    constructor(status: Veredict, spanTime?: number){
+    constructor(status: Verdict, spanTime?: number){
         this.status = status;
         this.spanTime = spanTime;
     }
 }
 
 export class SolutionResult{
-    status: Veredict;
+    status: Verdict;
     failTcId?: string;
     maxTime?: number;
 
-    constructor(status: Veredict, failTcId?: string, maxTime?: number){
+    constructor(status: Verdict, failTcId?: string, maxTime?: number){
         this.status = status;
         this.failTcId = failTcId;
         this.maxTime = maxTime;

+ 2 - 2
todo.md

@@ -5,7 +5,7 @@
 
 * [005](/src/core.ts): Restrict brute in time, and capture errors
   * Allow stopping a running program (such as sol.cpp/brute.cpp/gen.py/etc...)
-* [007](/src/extension.ts): How can I have access to new proccess created using `openFolder`?
+* [007](/src/extension.ts): How can I have access to new process created using `openFolder`?
 * Add Telegram group join link in the Readme
 * Add gif to README. Gif should be a tutorial (how to use).
 
@@ -17,7 +17,7 @@
 ## Settings
 
 Particular settings (per problem) configuration on current workspace.
-This can be done creating such configurations globally and udpating them per workspace (only problem here is that in one workspace might coexist several programs so best answer is probably creating a config file inside each problem and access them through cool UI settings provided by VSCode. This can be done since GitLens already do that.) Store also problem name on this config file, maybe URL.
+This can be done creating such configurations globally and updating them per workspace (only problem here is that in one workspace might coexist several programs so best answer is probably creating a config file inside each problem and access them through cool UI settings provided by VSCode. This can be done since GitLens already do that.) Store also problem name on this config file, maybe URL.
 
 * Make a new command to open particular settings of a problem