mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 05:08:06 -06:00
extra clientstate tests
This commit is contained in:
@@ -77,3 +77,36 @@ describe("Normalizing clientstate", () => {
|
||||
normalizer.normalized.should.deep.equal(resultdata);
|
||||
});
|
||||
});
|
||||
|
||||
describe("ClientState parsing", () => {
|
||||
it("Should work without executors", () => {
|
||||
const state = new clientstate.State({
|
||||
"sessions": [
|
||||
{"id":1,
|
||||
"language":"c++",
|
||||
"source":"int main() {}",
|
||||
"compilers":[{"id":"g91","options":"-O3 -std=c++2a"}]
|
||||
}]
|
||||
});
|
||||
|
||||
state.sessions[0].compilers.length.should.equal(1);
|
||||
state.sessions[0].executors.length.should.equal(0);
|
||||
});
|
||||
|
||||
it("Should work with executor", () => {
|
||||
const state = new clientstate.State({
|
||||
"sessions": [
|
||||
{"id":1,
|
||||
"language":"c++",
|
||||
"source":"int main() {}",
|
||||
"compilers": [],
|
||||
"executors":[{
|
||||
"compiler":{"id":"g91","options":"-O3 -std=c++2a"}
|
||||
}]
|
||||
}]
|
||||
});
|
||||
|
||||
state.sessions[0].compilers.length.should.equal(0);
|
||||
state.sessions[0].executors.length.should.equal(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user