mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-07 00:38:51 -06:00
web: Reorganize into frontend/backend
This commit is contained in:
30
web/frontend/src/core/Operations/commonOps.test.ts
Normal file
30
web/frontend/src/core/Operations/commonOps.test.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* UnitCommitment.jl: Optimization Package for Security-Constrained Unit Commitment
|
||||
* Copyright (C) 2020-2025, UChicago Argonne, LLC. All rights reserved.
|
||||
* Released under the modified BSD license. See COPYING.md for more details.
|
||||
*/
|
||||
|
||||
import { parseBool } from "./commonOps";
|
||||
import assert from "node:assert";
|
||||
|
||||
test("parseBool", () => {
|
||||
// True values
|
||||
for (const str of ["true", "TRUE", "1"]) {
|
||||
let [v, err] = parseBool(str);
|
||||
assert(!err);
|
||||
assert.equal(v, true);
|
||||
}
|
||||
|
||||
// False values
|
||||
for (const str of ["false", "FALSE", "0"]) {
|
||||
let [v, err] = parseBool(str);
|
||||
assert(!err);
|
||||
assert.equal(v, false);
|
||||
}
|
||||
|
||||
// Invalid values
|
||||
for (const str of ["qwe", ""]) {
|
||||
let [, err] = parseBool(str);
|
||||
assert(err);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user