|
@@ -8,7 +8,8 @@ import * as assert from 'assert';
|
|
|
import { dirname, join } from 'path';
|
|
|
import { timedRun, testcasesName, testSolution, newArena, ATTIC, TESTCASES, upgradeArena, stressSolution, newProblemFromId, newContestFromId } from '../core';
|
|
|
import { TestcaseResult, Veredict } from '../types';
|
|
|
-import { rmdirSync, existsSync, readdirSync, unlinkSync, openSync, writeSync, closeSync, readSync } from 'fs';
|
|
|
+import { rmdirSync, existsSync, readdirSync, unlinkSync, openSync, writeSync, closeSync, readSync, fstat } from 'fs';
|
|
|
+
|
|
|
|
|
|
const SRC = join(dirname(dirname(dirname(__filename))), 'src', 'test');
|
|
|
const ARENA = join(SRC, 'arena');
|
|
@@ -291,19 +292,6 @@ suite("Extension Tests", function () {
|
|
|
recRmdir(path);
|
|
|
});
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
function readFile(path: string){
|
|
|
let fd = openSync(path, "r");
|
|
|
let buffer = new Buffer(1 << 20);
|
|
@@ -312,6 +300,21 @@ suite("Extension Tests", function () {
|
|
|
return answer;
|
|
|
}
|
|
|
|
|
|
+ test("downloading", async function(){
|
|
|
+ let request = require('request');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ await request('http://codeforces.com/contest/1081/problem/E', function(error: any, response: any, body: any){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ writeFile(join(SRC, "codeforces.html"), body);
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
test("parsing", function(){
|
|
|
let html: string = readFile(join(__dirname, "codeforces.html"));
|
|
|
let pos = 0;
|
|
@@ -344,4 +347,14 @@ suite("Extension Tests", function () {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ test("parsingLocalhost", function(){
|
|
|
+ let request = require('request');
|
|
|
+
|
|
|
+ request('http://localhost:8000/libros', function (error: any, response: any, body: any) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|