2019-08-25 09:39:20 +03:00
|
|
|
'use strict';
|
|
|
|
import path from 'path';
|
|
|
|
import zlib from "browserify-zlib";
|
2019-11-23 15:38:13 +03:00
|
|
|
import { randomBytes, randomHexString, randomNumber } from "./random";
|
|
|
|
export { randomBytes, randomHexString, randomNumber };
|
2019-08-25 09:39:20 +03:00
|
|
|
import * as data from "./browser-fs.json";
|
2019-11-23 15:38:13 +03:00
|
|
|
const Cache = {};
|
2019-08-25 09:39:20 +03:00
|
|
|
export function loadTests(tag) {
|
|
|
|
let filename = 'testcases/' + tag + ".json.gz";
|
2019-11-23 15:38:13 +03:00
|
|
|
if (Cache[filename] == null) {
|
|
|
|
console.log("loading:", filename);
|
|
|
|
Cache[filename] = JSON.parse(zlib.gunzipSync(new Buffer(data[filename], "base64")).toString());
|
|
|
|
}
|
|
|
|
return Cache[filename];
|
2019-08-25 09:39:20 +03:00
|
|
|
}
|
|
|
|
export function loadData(filename) {
|
|
|
|
// Strip any leading relative paths (e.g. "./foo" => "foo")
|
|
|
|
filename = path.join(filename);
|
|
|
|
console.log("loading:", filename);
|
|
|
|
return new Buffer(data[filename], "base64");
|
|
|
|
}
|
2020-07-13 15:03:56 +03:00
|
|
|
//# sourceMappingURL=browser.js.map
|