-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
854 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Forbidden if something has not been commited | ||
if ! git diff-index --quiet HEAD --; then | ||
echo "Please commit your local changes!" | ||
exit 1 | ||
fi | ||
|
||
# Extract details concerning the current environnment | ||
rawCurrentBranch="$(git branch | grep "*")" | ||
currentBranch="$(expr substr "${rawCurrentBranch}" 3 1000)" | ||
|
||
# Move to commit and build it | ||
commitId=$1 | ||
if [ -z "$commitId" ] | ||
then | ||
echo "Please provide a commit id!" | ||
exit 1 | ||
fi | ||
target=$2 | ||
if [ -z "$target" ] | ||
target="es6" | ||
fi | ||
git checkout "${commitId}" | ||
yarn | ||
./node_modules/typescript/bin/tsc --target "${target}" --outDir "lib-${commitId}/" | ||
|
||
# Move back to original location | ||
git checkout "${currentBranch}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,25 @@ | ||
// @ts-check | ||
|
||
// Call next multiple times on the passed generator | ||
/** Call next multiple times on the passed generator */ | ||
exports.testNext = (g, NUM_TESTS) => { | ||
for (let idx = 0; idx !== NUM_TESTS; ++idx) { | ||
g = g.next()[1]; | ||
} | ||
return g; | ||
}; | ||
|
||
// Cell jump multiple times on the passed generator | ||
/** Call jump multiple times on the passed generator */ | ||
exports.testJump = (g, NUM_TESTS) => { | ||
for (let idx = 0; idx !== NUM_TESTS; ++idx) { | ||
g = g.jump(); | ||
} | ||
return g; | ||
}; | ||
|
||
// Avoid the construction of an intermediate distribution | ||
exports.testGenerateWithSkipDistributionSingle = (lib, g) => { | ||
return lib.uniformIntDistribution(0, 0xffffffff, g)[1]; | ||
}; | ||
exports.testGenerateWithSkipDistribution = (lib, g, NUM_TESTS) => { | ||
for (let idx = 0; idx !== NUM_TESTS; ++idx) { | ||
g = exports.testGenerateWithSkipDistributionSingle(lib, g); | ||
} | ||
return g; | ||
}; | ||
|
||
// Build the distribution once | ||
// then generate multiple values using it | ||
exports.testGenerateWithSameDistribution = (lib, g, NUM_TESTS) => { | ||
const dist = lib.uniformIntDistribution(0, 0xffffffff); | ||
/** Avoid the construction of an intermediate distribution */ | ||
exports.testDistribution = (distribution, g, NUM_TESTS, settings = { min: 0, max: 0xffffffff }) => { | ||
for (let idx = 0; idx !== NUM_TESTS; ++idx) { | ||
g = dist(g)[1]; | ||
g = distribution(settings.min, settings.max, g)[1]; | ||
} | ||
return g; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.