Files
metabuilder/gameengine/packages/materialx/javascript/MaterialXTest/value.spec.js
johndoe6345789 6fbc47a2db feat: Add SDL3CPlusPlus game engine to gameengine/
Import SDL3CPlusPlus C++ game engine with:
- SDL3 + bgfx rendering backend
- Vulkan/Metal/DirectX shader support
- MaterialX material system
- Scene framework with ECS architecture
- Comprehensive test suite (TDD approach)
- Conan package management
- CMake build system

This provides the native C++ foundation for the Universal Platform's
Game and 3D capability modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 16:29:20 +00:00

43 lines
1.3 KiB
JavaScript
Executable File

import { expect } from 'chai';;
import Module from './_build/JsMaterialXCore.js';
describe('Value', () =>
{
let mx;
before(async () =>
{
mx = await Module();
});
it('Create values of different types', () =>
{
const testValues = {
integer: '1',
boolean: 'true',
float: '1.1',
color3: '0.1, 0.2, 0.3',
color4: '0.1, 0.2, 0.3, 0.4',
vector2: '1.1, 2.1',
vector3: '1.1, 2.1, 3.1',
vector4: '1.1, 2.1, 3.1, 4.1',
matrix33: '0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1',
matrix44: '1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1',
string: 'value',
integerarray: '1, 2, 3',
booleanarray: 'false, true, false',
floatarray: '1.1, 2.1, 3.1',
stringarray: "'one', 'two', 'three'",
};
for (let type in testValues)
{
const value = testValues[String(type)];
const newValue = mx.Value.createValueFromStrings(value, type);
const typeString = newValue.getTypeString();
const valueString = newValue.getValueString();
expect(typeString).to.equal(type);
expect(valueString).to.equal(value);
}
});
});