Modernize generated JS tests

This commit is contained in:
Nick Gerleman
2022-12-24 00:35:10 -08:00
parent 0f67a0a458
commit 014986e9da
27 changed files with 9213 additions and 9214 deletions

View File

@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
var JavascriptEmitter = function() { const JavascriptEmitter = function() {
Emitter.call(this, 'js', ' '); Emitter.call(this, 'js', ' ');
}; };
@@ -17,9 +17,8 @@ function toValueJavascript(value) {
} }
function toJavascriptUpper(symbol) { function toJavascriptUpper(symbol) {
var out = ''; let out = '';
for (var i = 0; i < symbol.length; i++) { for (const c of symbol) {
var c = symbol[i];
if (c == c.toUpperCase() && i != 0 && symbol[i - 1] != symbol[i - 1].toUpperCase()) { if (c == c.toUpperCase() && i != 0 && symbol[i - 1] != symbol[i - 1].toUpperCase()) {
out += '_'; out += '_';
} }
@@ -36,11 +35,11 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
emitTestPrologue:{value:function(name, experiments) { emitTestPrologue:{value:function(name, experiments) {
this.push('it(' + JSON.stringify(name) + ', function () {'); this.push('it(' + JSON.stringify(name) + ', function () {');
this.pushIndent(); this.pushIndent();
this.push('var config = Yoga.Config.create();'); this.push('const config = Yoga.Config.create();');
this.push(''); this.push('');
if (experiments.length > 0) { if (experiments.length > 0) {
for (var i in experiments) { for (const i in experiments) {
this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiments[i]) + ', true);'); this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiments[i]) + ', true);');
} }
this.push(''); this.push('');
@@ -51,7 +50,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
}}, }},
emitTestTreePrologue:{value:function(nodeName) { emitTestTreePrologue:{value:function(nodeName) {
this.push('var ' + nodeName + ' = Yoga.Node.create(config);'); this.push('const ' + nodeName + ' = Yoga.Node.create(config);');
}}, }},
emitTestEpilogue:{value:function(experiments) { emitTestEpilogue:{value:function(experiments) {

View File

@@ -6,34 +6,34 @@
*/ */
it("align_baseline_parent_using_child_in_column_as_reference", function () { it("align_baseline_parent_using_child_in_column_as_reference", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(1000); root.setWidth(1000);
root.setHeight(1000); root.setHeight(1000);
root.setAlignItems(Yoga.ALIGN_BASELINE); root.setAlignItems(Yoga.ALIGN_BASELINE);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
root_child0.setWidth(500); root_child0.setWidth(500);
root_child0.setHeight(600); root_child0.setHeight(600);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
root_child1.setWidth(500); root_child1.setWidth(500);
root_child1.setHeight(800); root_child1.setHeight(800);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child1_child0 = Yoga.Node.create(config); const root_child1_child0 = Yoga.Node.create(config);
root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
root_child1_child0.setWidth(500); root_child1_child0.setWidth(500);
root_child1_child0.setHeight(300); root_child1_child0.setHeight(300);
root_child1.insertChild(root_child1_child0, 0); root_child1.insertChild(root_child1_child0, 0);
var root_child1_child1 = Yoga.Node.create(config); const root_child1_child1 = Yoga.Node.create(config);
root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
root_child1_child1.setWidth(500); root_child1_child1.setWidth(500);
root_child1_child1.setHeight(400); root_child1_child1.setHeight(400);
@@ -80,34 +80,34 @@ it("align_baseline_parent_using_child_in_column_as_reference", function () {
}); });
it("align_baseline_parent_using_child_in_row_as_reference", function () { it("align_baseline_parent_using_child_in_row_as_reference", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(1000); root.setWidth(1000);
root.setHeight(1000); root.setHeight(1000);
root.setAlignItems(Yoga.ALIGN_BASELINE); root.setAlignItems(Yoga.ALIGN_BASELINE);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
root_child0.setWidth(500); root_child0.setWidth(500);
root_child0.setHeight(600); root_child0.setHeight(600);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root_child1.setWidth(500); root_child1.setWidth(500);
root_child1.setHeight(800); root_child1.setHeight(800);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child1_child0 = Yoga.Node.create(config); const root_child1_child0 = Yoga.Node.create(config);
root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
root_child1_child0.setWidth(500); root_child1_child0.setWidth(500);
root_child1_child0.setHeight(500); root_child1_child0.setHeight(500);
root_child1.insertChild(root_child1_child0, 0); root_child1.insertChild(root_child1_child0, 0);
var root_child1_child1 = Yoga.Node.create(config); const root_child1_child1 = Yoga.Node.create(config);
root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
root_child1_child1.setWidth(500); root_child1_child1.setWidth(500);
root_child1_child1.setHeight(400); root_child1_child1.setHeight(400);

View File

@@ -6,7 +6,7 @@
*/ */
it("border_start", function () { it("border_start", function () {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
root.setBorder(Yoga.EDGE_START, 10); root.setBorder(Yoga.EDGE_START, 10);

View File

@@ -6,7 +6,7 @@
*/ */
it("margin_start", function () { it("margin_start", function () {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
root.setMargin(Yoga.EDGE_START, `10%`); root.setMargin(Yoga.EDGE_START, `10%`);

View File

@@ -6,7 +6,7 @@
*/ */
it("padding_start", function () { it("padding_start", function () {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
root.setPadding(Yoga.EDGE_START, `10%`); root.setPadding(Yoga.EDGE_START, `10%`);

View File

@@ -6,7 +6,7 @@
*/ */
it("dirtied", function() { it("dirtied", function() {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
@@ -36,19 +36,19 @@ it("dirtied", function() {
}); });
it("dirtied_propagation", function() { it("dirtied_propagation", function() {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(); const root_child0 = Yoga.Node.create();
root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
root_child0.setWidth(50); root_child0.setWidth(50);
root_child0.setHeight(20); root_child0.setHeight(20);
root_child0.setMeasureFunc(function() {}); root_child0.setMeasureFunc(function() {});
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(); const root_child1 = Yoga.Node.create();
root_child1.setAlignItems(Yoga.ALIGN_FLEX_START); root_child1.setAlignItems(Yoga.ALIGN_FLEX_START);
root_child1.setWidth(50); root_child1.setWidth(50);
root_child1.setHeight(20); root_child1.setHeight(20);
@@ -77,19 +77,19 @@ it("dirtied_propagation", function() {
}); });
it("dirtied_hierarchy", function() { it("dirtied_hierarchy", function() {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(); const root_child0 = Yoga.Node.create();
root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
root_child0.setWidth(50); root_child0.setWidth(50);
root_child0.setHeight(20); root_child0.setHeight(20);
root_child0.setMeasureFunc(function() {}); root_child0.setMeasureFunc(function() {});
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(); const root_child1 = Yoga.Node.create();
root_child1.setAlignItems(Yoga.ALIGN_FLEX_START); root_child1.setAlignItems(Yoga.ALIGN_FLEX_START);
root_child1.setWidth(50); root_child1.setWidth(50);
root_child1.setHeight(20); root_child1.setHeight(20);
@@ -124,7 +124,7 @@ it("dirtied_hierarchy", function() {
}); });
it("dirtied_reset", function() { it("dirtied_reset", function() {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);

View File

@@ -6,15 +6,15 @@
*/ */
it("measure_once_single_flexible_child", function () { it("measure_once_single_flexible_child", function () {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var measureCounter = getMeasureCounterMax(Yoga); const measureCounter = getMeasureCounterMax(Yoga);
var root_child0 = Yoga.Node.create(); const root_child0 = Yoga.Node.create();
root_child0.setMeasureFunc(measureCounter.inc); root_child0.setMeasureFunc(measureCounter.inc);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);

View File

@@ -6,13 +6,13 @@
*/ */
it("dont_measure_single_grow_shrink_child", function () { it("dont_measure_single_grow_shrink_child", function () {
var root = Yoga.Node.create(); const root = Yoga.Node.create();
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var measureCounter = getMeasureCounter(Yoga, null, 100, 100); const measureCounter = getMeasureCounter(Yoga, null, 100, 100);
var root_child0 = Yoga.Node.create(); const root_child0 = Yoga.Node.create();
root_child0.setMeasureFunc(measureCounter.inc); root_child0.setMeasureFunc(measureCounter.inc);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root_child0.setFlexShrink(1); root_child0.setFlexShrink(1);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -7,42 +7,42 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html
it("align_self_center", function () { test("align_self_center", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setAlignSelf(Yoga.ALIGN_CENTER); root_child0.setAlignSelf(Yoga.ALIGN_CENTER);
root_child0.setWidth(10); root_child0.setWidth(10);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(45);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(45);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -51,42 +51,42 @@ it("align_self_center", function () {
config.free(); config.free();
} }
}); });
it("align_self_flex_end", function () { test("align_self_flex_end", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
root_child0.setWidth(10); root_child0.setWidth(10);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(90);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -95,42 +95,42 @@ it("align_self_flex_end", function () {
config.free(); config.free();
} }
}); });
it("align_self_flex_start", function () { test("align_self_flex_start", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setAlignSelf(Yoga.ALIGN_FLEX_START); root_child0.setAlignSelf(Yoga.ALIGN_FLEX_START);
root_child0.setWidth(10); root_child0.setWidth(10);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(90);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -139,43 +139,43 @@ it("align_self_flex_start", function () {
config.free(); config.free();
} }
}); });
it("align_self_flex_end_override_flex_start", function () { test("align_self_flex_end_override_flex_start", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
root_child0.setWidth(10); root_child0.setWidth(10);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(90);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -184,74 +184,74 @@ it("align_self_flex_end_override_flex_start", function () {
config.free(); config.free();
} }
}); });
it("align_self_baseline", function () { test("align_self_baseline", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setAlignSelf(Yoga.ALIGN_BASELINE); root_child0.setAlignSelf(Yoga.ALIGN_BASELINE);
root_child0.setWidth(50); root_child0.setWidth(50);
root_child0.setHeight(50); root_child0.setHeight(50);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setAlignSelf(Yoga.ALIGN_BASELINE); root_child1.setAlignSelf(Yoga.ALIGN_BASELINE);
root_child1.setWidth(50); root_child1.setWidth(50);
root_child1.setHeight(20); root_child1.setHeight(20);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child1_child0 = Yoga.Node.create(config); const root_child1_child0 = Yoga.Node.create(config);
root_child1_child0.setWidth(50); root_child1_child0.setWidth(50);
root_child1_child0.setHeight(10); root_child1_child0.setHeight(10);
root_child1.insertChild(root_child1_child0, 0); root_child1.insertChild(root_child1_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(50);
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(50);
console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(50);
console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(40);
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(50);
console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(20);
console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); expect(root_child1_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); expect(root_child1_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); expect(root_child1_child0.getComputedWidth()).toBe(50);
console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); expect(root_child1_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(50);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(50);
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(50);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(40);
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(50);
console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(20);
console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); expect(root_child1_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); expect(root_child1_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); expect(root_child1_child0.getComputedWidth()).toBe(50);
console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); expect(root_child1_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();

View File

@@ -7,26 +7,26 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
it("android_news_feed", function () { test("android_news_feed", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setAlignContent(Yoga.ALIGN_STRETCH); root.setAlignContent(Yoga.ALIGN_STRETCH);
root.setWidth(1080); root.setWidth(1080);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child0_child0 = Yoga.Node.create(config); const root_child0_child0 = Yoga.Node.create(config);
root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0.insertChild(root_child0_child0, 0); root_child0.insertChild(root_child0_child0, 0);
var root_child0_child0_child0 = Yoga.Node.create(config); const root_child0_child0_child0 = Yoga.Node.create(config);
root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0.insertChild(root_child0_child0_child0, 0); root_child0_child0.insertChild(root_child0_child0_child0, 0);
var root_child0_child0_child0_child0 = Yoga.Node.create(config); const root_child0_child0_child0_child0 = Yoga.Node.create(config);
root_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child0_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0_child0_child0_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
@@ -34,18 +34,18 @@ it("android_news_feed", function () {
root_child0_child0_child0_child0.setMargin(Yoga.EDGE_TOP, 24); root_child0_child0_child0_child0.setMargin(Yoga.EDGE_TOP, 24);
root_child0_child0_child0.insertChild(root_child0_child0_child0_child0, 0); root_child0_child0_child0.insertChild(root_child0_child0_child0_child0, 0);
var root_child0_child0_child0_child0_child0 = Yoga.Node.create(config); const root_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
root_child0_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0, 0); root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0, 0);
var root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config); const root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
root_child0_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child0_child0_child0_child0.setWidth(120); root_child0_child0_child0_child0_child0_child0.setWidth(120);
root_child0_child0_child0_child0_child0_child0.setHeight(120); root_child0_child0_child0_child0_child0_child0.setHeight(120);
root_child0_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0_child0, 0); root_child0_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0_child0, 0);
var root_child0_child0_child0_child0_child1 = Yoga.Node.create(config); const root_child0_child0_child0_child0_child1 = Yoga.Node.create(config);
root_child0_child0_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child0_child0_child1.setFlexShrink(1); root_child0_child0_child0_child0_child1.setFlexShrink(1);
root_child0_child0_child0_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36); root_child0_child0_child0_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36);
@@ -55,22 +55,22 @@ it("android_news_feed", function () {
root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18); root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18);
root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child1, 1); root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child1, 1);
var root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config); const root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config);
root_child0_child0_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root_child0_child0_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child0_child0_child1_child0.setFlexShrink(1); root_child0_child0_child0_child0_child1_child0.setFlexShrink(1);
root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child0, 0); root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child0, 0);
var root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config); const root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config);
root_child0_child0_child0_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child0_child0_child1_child1.setFlexShrink(1); root_child0_child0_child0_child0_child1_child1.setFlexShrink(1);
root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child1, 1); root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child1, 1);
var root_child0_child0_child1 = Yoga.Node.create(config); const root_child0_child0_child1 = Yoga.Node.create(config);
root_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0.insertChild(root_child0_child0_child1, 1); root_child0_child0.insertChild(root_child0_child0_child1, 1);
var root_child0_child0_child1_child0 = Yoga.Node.create(config); const root_child0_child0_child1_child0 = Yoga.Node.create(config);
root_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child1_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0_child0_child1_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
@@ -78,18 +78,18 @@ it("android_news_feed", function () {
root_child0_child0_child1_child0.setMargin(Yoga.EDGE_TOP, 24); root_child0_child0_child1_child0.setMargin(Yoga.EDGE_TOP, 24);
root_child0_child0_child1.insertChild(root_child0_child0_child1_child0, 0); root_child0_child0_child1.insertChild(root_child0_child0_child1_child0, 0);
var root_child0_child0_child1_child0_child0 = Yoga.Node.create(config); const root_child0_child0_child1_child0_child0 = Yoga.Node.create(config);
root_child0_child0_child1_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child1_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root_child0_child0_child1_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child0, 0); root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child0, 0);
var root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config); const root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config);
root_child0_child0_child1_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child1_child0_child0_child0.setWidth(72); root_child0_child0_child1_child0_child0_child0.setWidth(72);
root_child0_child0_child1_child0_child0_child0.setHeight(72); root_child0_child0_child1_child0_child0_child0.setHeight(72);
root_child0_child0_child1_child0_child0.insertChild(root_child0_child0_child1_child0_child0_child0, 0); root_child0_child0_child1_child0_child0.insertChild(root_child0_child0_child1_child0_child0_child0, 0);
var root_child0_child0_child1_child0_child1 = Yoga.Node.create(config); const root_child0_child0_child1_child0_child1 = Yoga.Node.create(config);
root_child0_child0_child1_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child1_child0_child1.setFlexShrink(1); root_child0_child0_child1_child0_child1.setFlexShrink(1);
root_child0_child0_child1_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36); root_child0_child0_child1_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36);
@@ -99,189 +99,189 @@ it("android_news_feed", function () {
root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18); root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18);
root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child1, 1); root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child1, 1);
var root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config); const root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config);
root_child0_child0_child1_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child1_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root_child0_child0_child1_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child1_child0_child1_child0.setFlexShrink(1); root_child0_child0_child1_child0_child1_child0.setFlexShrink(1);
root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child0, 0); root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child0, 0);
var root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config); const root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config);
root_child0_child0_child1_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH);
root_child0_child0_child1_child0_child1_child1.setFlexShrink(1); root_child0_child0_child1_child0_child1_child1.setFlexShrink(1);
root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1); root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(1080);
console.assert(240 === root.getComputedHeight(), "240 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(240);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(1080);
console.assert(240 === root_child0.getComputedHeight(), "240 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(240);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(1080 === root_child0_child0.getComputedWidth(), "1080 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(1080);
console.assert(240 === root_child0_child0.getComputedHeight(), "240 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(240);
console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child0.getComputedTop()).toBe(0);
console.assert(1080 === root_child0_child0_child0.getComputedWidth(), "1080 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0.getComputedWidth()).toBe(1080);
console.assert(144 === root_child0_child0_child0.getComputedHeight(), "144 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0.getComputedHeight()).toBe(144);
console.assert(36 === root_child0_child0_child0_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0.getComputedLeft()).toBe(36);
console.assert(24 === root_child0_child0_child0_child0.getComputedTop(), "24 === root_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child0_child0.getComputedTop()).toBe(24);
console.assert(1044 === root_child0_child0_child0_child0.getComputedWidth(), "1044 === root_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0.getComputedWidth()).toBe(1044);
console.assert(120 === root_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0.getComputedHeight()).toBe(120);
console.assert(0 === root_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child0.getComputedTop()).toBe(0);
console.assert(120 === root_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120);
console.assert(120 === root_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120);
console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child0_child0.getComputedTop()).toBe(0);
console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120);
console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120);
console.assert(120 === root_child0_child0_child0_child0_child1.getComputedLeft(), "120 === root_child0_child0_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child1.getComputedLeft()).toBe(120);
console.assert(0 === root_child0_child0_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child0_child0_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child1.getComputedTop()).toBe(0);
console.assert(72 === root_child0_child0_child0_child0_child1.getComputedWidth(), "72 === root_child0_child0_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child1.getComputedWidth()).toBe(72);
console.assert(39 === root_child0_child0_child0_child0_child1.getComputedHeight(), "39 === root_child0_child0_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child1.getComputedHeight()).toBe(39);
console.assert(36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child1_child0.getComputedLeft()).toBe(36);
console.assert(21 === root_child0_child0_child0_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child0_child0_child1_child0.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child1_child0.getComputedTop()).toBe(21);
console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child1_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child1_child0.getComputedHeight()).toBe(0);
console.assert(36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child1.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child1_child1.getComputedLeft()).toBe(36);
console.assert(21 === root_child0_child0_child0_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1_child1.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child1_child1.getComputedTop()).toBe(21);
console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child1.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child1_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child1.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child1_child1.getComputedHeight()).toBe(0);
console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")"); expect(root_child0_child0_child1.getComputedLeft()).toBe(0);
console.assert(144 === root_child0_child0_child1.getComputedTop(), "144 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")"); expect(root_child0_child0_child1.getComputedTop()).toBe(144);
console.assert(1080 === root_child0_child0_child1.getComputedWidth(), "1080 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")"); expect(root_child0_child0_child1.getComputedWidth()).toBe(1080);
console.assert(96 === root_child0_child0_child1.getComputedHeight(), "96 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")"); expect(root_child0_child0_child1.getComputedHeight()).toBe(96);
console.assert(174 === root_child0_child0_child1_child0.getComputedLeft(), "174 === root_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0.getComputedLeft()).toBe(174);
console.assert(24 === root_child0_child0_child1_child0.getComputedTop(), "24 === root_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0.getComputedTop() + ")"); expect(root_child0_child0_child1_child0.getComputedTop()).toBe(24);
console.assert(906 === root_child0_child0_child1_child0.getComputedWidth(), "906 === root_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0.getComputedWidth()).toBe(906);
console.assert(72 === root_child0_child0_child1_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0.getComputedHeight()).toBe(72);
console.assert(0 === root_child0_child0_child1_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0_child1_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child0.getComputedTop()).toBe(0);
console.assert(72 === root_child0_child0_child1_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child0.getComputedWidth()).toBe(72);
console.assert(72 === root_child0_child0_child1_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child0.getComputedHeight()).toBe(72);
console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child0_child0.getComputedTop()).toBe(0);
console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child0_child0.getComputedWidth()).toBe(72);
console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child0_child0.getComputedHeight()).toBe(72);
console.assert(72 === root_child0_child0_child1_child0_child1.getComputedLeft(), "72 === root_child0_child0_child1_child0_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child1.getComputedLeft()).toBe(72);
console.assert(0 === root_child0_child0_child1_child0_child1.getComputedTop(), "0 === root_child0_child0_child1_child0_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child1.getComputedTop()).toBe(0);
console.assert(72 === root_child0_child0_child1_child0_child1.getComputedWidth(), "72 === root_child0_child0_child1_child0_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child1.getComputedWidth()).toBe(72);
console.assert(39 === root_child0_child0_child1_child0_child1.getComputedHeight(), "39 === root_child0_child0_child1_child0_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child1.getComputedHeight()).toBe(39);
console.assert(36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child0.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child1_child0.getComputedLeft()).toBe(36);
console.assert(21 === root_child0_child0_child1_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0_child1_child0.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child1_child0.getComputedTop()).toBe(21);
console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child0.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child1_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child0.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child1_child0.getComputedHeight()).toBe(0);
console.assert(36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child1.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child1_child1.getComputedLeft()).toBe(36);
console.assert(21 === root_child0_child0_child1_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1_child1.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child1_child1.getComputedTop()).toBe(21);
console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child1.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child1.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(1080);
console.assert(240 === root.getComputedHeight(), "240 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(240);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(1080);
console.assert(240 === root_child0.getComputedHeight(), "240 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(240);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(1080 === root_child0_child0.getComputedWidth(), "1080 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(1080);
console.assert(240 === root_child0_child0.getComputedHeight(), "240 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(240);
console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child0.getComputedTop()).toBe(0);
console.assert(1080 === root_child0_child0_child0.getComputedWidth(), "1080 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0.getComputedWidth()).toBe(1080);
console.assert(144 === root_child0_child0_child0.getComputedHeight(), "144 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0.getComputedHeight()).toBe(144);
console.assert(0 === root_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0.getComputedLeft()).toBe(0);
console.assert(24 === root_child0_child0_child0_child0.getComputedTop(), "24 === root_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child0_child0.getComputedTop()).toBe(24);
console.assert(1044 === root_child0_child0_child0_child0.getComputedWidth(), "1044 === root_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0.getComputedWidth()).toBe(1044);
console.assert(120 === root_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0.getComputedHeight()).toBe(120);
console.assert(924 === root_child0_child0_child0_child0_child0.getComputedLeft(), "924 === root_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child0.getComputedLeft()).toBe(924);
console.assert(0 === root_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child0.getComputedTop()).toBe(0);
console.assert(120 === root_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120);
console.assert(120 === root_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120);
console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child0_child0.getComputedTop()).toBe(0);
console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120);
console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120);
console.assert(816 === root_child0_child0_child0_child0_child1.getComputedLeft(), "816 === root_child0_child0_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child1.getComputedLeft()).toBe(816);
console.assert(0 === root_child0_child0_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child0_child0_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child1.getComputedTop()).toBe(0);
console.assert(72 === root_child0_child0_child0_child0_child1.getComputedWidth(), "72 === root_child0_child0_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child1.getComputedWidth()).toBe(72);
console.assert(39 === root_child0_child0_child0_child0_child1.getComputedHeight(), "39 === root_child0_child0_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child1.getComputedHeight()).toBe(39);
console.assert(36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child0.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child1_child0.getComputedLeft()).toBe(36);
console.assert(21 === root_child0_child0_child0_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child0_child0_child1_child0.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child1_child0.getComputedTop()).toBe(21);
console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child0.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child1_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child0.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child1_child0.getComputedHeight()).toBe(0);
console.assert(36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child1.getComputedLeft() + ")"); expect(root_child0_child0_child0_child0_child1_child1.getComputedLeft()).toBe(36);
console.assert(21 === root_child0_child0_child0_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1_child1.getComputedTop() + ")"); expect(root_child0_child0_child0_child0_child1_child1.getComputedTop()).toBe(21);
console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child1.getComputedWidth() + ")"); expect(root_child0_child0_child0_child0_child1_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child1.getComputedHeight() + ")"); expect(root_child0_child0_child0_child0_child1_child1.getComputedHeight()).toBe(0);
console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")"); expect(root_child0_child0_child1.getComputedLeft()).toBe(0);
console.assert(144 === root_child0_child0_child1.getComputedTop(), "144 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")"); expect(root_child0_child0_child1.getComputedTop()).toBe(144);
console.assert(1080 === root_child0_child0_child1.getComputedWidth(), "1080 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")"); expect(root_child0_child0_child1.getComputedWidth()).toBe(1080);
console.assert(96 === root_child0_child0_child1.getComputedHeight(), "96 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")"); expect(root_child0_child0_child1.getComputedHeight()).toBe(96);
console.assert(0 === root_child0_child0_child1_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0.getComputedLeft()).toBe(0);
console.assert(24 === root_child0_child0_child1_child0.getComputedTop(), "24 === root_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0.getComputedTop() + ")"); expect(root_child0_child0_child1_child0.getComputedTop()).toBe(24);
console.assert(906 === root_child0_child0_child1_child0.getComputedWidth(), "906 === root_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0.getComputedWidth()).toBe(906);
console.assert(72 === root_child0_child0_child1_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0.getComputedHeight()).toBe(72);
console.assert(834 === root_child0_child0_child1_child0_child0.getComputedLeft(), "834 === root_child0_child0_child1_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child0.getComputedLeft()).toBe(834);
console.assert(0 === root_child0_child0_child1_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child0.getComputedTop()).toBe(0);
console.assert(72 === root_child0_child0_child1_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child0.getComputedWidth()).toBe(72);
console.assert(72 === root_child0_child0_child1_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child0.getComputedHeight()).toBe(72);
console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0_child0.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child0_child0.getComputedTop()).toBe(0);
console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child0_child0.getComputedWidth()).toBe(72);
console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child0_child0.getComputedHeight()).toBe(72);
console.assert(726 === root_child0_child0_child1_child0_child1.getComputedLeft(), "726 === root_child0_child0_child1_child0_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child1.getComputedLeft()).toBe(726);
console.assert(0 === root_child0_child0_child1_child0_child1.getComputedTop(), "0 === root_child0_child0_child1_child0_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child1.getComputedTop()).toBe(0);
console.assert(72 === root_child0_child0_child1_child0_child1.getComputedWidth(), "72 === root_child0_child0_child1_child0_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child1.getComputedWidth()).toBe(72);
console.assert(39 === root_child0_child0_child1_child0_child1.getComputedHeight(), "39 === root_child0_child0_child1_child0_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child1.getComputedHeight()).toBe(39);
console.assert(36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child0.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child1_child0.getComputedLeft()).toBe(36);
console.assert(21 === root_child0_child0_child1_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0_child1_child0.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child1_child0.getComputedTop()).toBe(21);
console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child0.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child1_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child0.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child1_child0.getComputedHeight()).toBe(0);
console.assert(36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child1.getComputedLeft() + ")"); expect(root_child0_child0_child1_child0_child1_child1.getComputedLeft()).toBe(36);
console.assert(21 === root_child0_child0_child1_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1_child1.getComputedTop() + ")"); expect(root_child0_child0_child1_child0_child1_child1.getComputedTop()).toBe(21);
console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child1.getComputedWidth() + ")"); expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child1.getComputedHeight() + ")"); expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();

View File

@@ -7,28 +7,28 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html
it("border_no_size", function () { test("border_no_size", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_LEFT, 10);
root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_TOP, 10);
root.setBorder(Yoga.EDGE_RIGHT, 10); root.setBorder(Yoga.EDGE_RIGHT, 10);
root.setBorder(Yoga.EDGE_BOTTOM, 10); root.setBorder(Yoga.EDGE_BOTTOM, 10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(20);
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(20);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(20);
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(20);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -37,43 +37,43 @@ it("border_no_size", function () {
config.free(); config.free();
} }
}); });
it("border_container_match_child", function () { test("border_container_match_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_LEFT, 10);
root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_TOP, 10);
root.setBorder(Yoga.EDGE_RIGHT, 10); root.setBorder(Yoga.EDGE_RIGHT, 10);
root.setBorder(Yoga.EDGE_BOTTOM, 10); root.setBorder(Yoga.EDGE_BOTTOM, 10);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(10); root_child0.setWidth(10);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(30);
console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(30);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(30);
console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(30);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -82,11 +82,11 @@ it("border_container_match_child", function () {
config.free(); config.free();
} }
}); });
it("border_flex_child", function () { test("border_flex_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_LEFT, 10);
root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_TOP, 10);
root.setBorder(Yoga.EDGE_RIGHT, 10); root.setBorder(Yoga.EDGE_RIGHT, 10);
@@ -94,33 +94,33 @@ it("border_flex_child", function () {
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root_child0.setWidth(10); root_child0.setWidth(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(80);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(80);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(80);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -129,11 +129,11 @@ it("border_flex_child", function () {
config.free(); config.free();
} }
}); });
it("border_stretch_child", function () { test("border_stretch_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_LEFT, 10);
root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_TOP, 10);
root.setBorder(Yoga.EDGE_RIGHT, 10); root.setBorder(Yoga.EDGE_RIGHT, 10);
@@ -141,32 +141,32 @@ it("border_stretch_child", function () {
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(80);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(80);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -175,11 +175,11 @@ it("border_stretch_child", function () {
config.free(); config.free();
} }
}); });
it("border_center_child", function () { test("border_center_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setJustifyContent(Yoga.JUSTIFY_CENTER);
root.setAlignItems(Yoga.ALIGN_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER);
root.setBorder(Yoga.EDGE_START, 10); root.setBorder(Yoga.EDGE_START, 10);
@@ -188,33 +188,33 @@ it("border_center_child", function () {
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(10); root_child0.setWidth(10);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(40);
console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(35);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(50);
console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(35);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();

View File

@@ -7,39 +7,39 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html
it("wrap_child", function () { test("wrap_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(100); root_child0.setWidth(100);
root_child0.setHeight(100); root_child0.setHeight(100);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -48,52 +48,52 @@ it("wrap_child", function () {
config.free(); config.free();
} }
}); });
it("wrap_grandchild", function () { test("wrap_grandchild", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child0_child0 = Yoga.Node.create(config); const root_child0_child0 = Yoga.Node.create(config);
root_child0_child0.setWidth(100); root_child0_child0.setWidth(100);
root_child0_child0.setHeight(100); root_child0_child0.setHeight(100);
root_child0.insertChild(root_child0_child0, 0); root_child0.insertChild(root_child0_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();

View File

@@ -7,56 +7,56 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html
it("display_none", function () { test("display_none", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(1); root_child1.setFlexGrow(1);
root_child1.setDisplay(Yoga.DISPLAY_NONE); root_child1.setDisplay(Yoga.DISPLAY_NONE);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -65,57 +65,57 @@ it("display_none", function () {
config.free(); config.free();
} }
}); });
it("display_none_fixed_size", function () { test("display_none_fixed_size", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setWidth(20); root_child1.setWidth(20);
root_child1.setHeight(20); root_child1.setHeight(20);
root_child1.setDisplay(Yoga.DISPLAY_NONE); root_child1.setDisplay(Yoga.DISPLAY_NONE);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -124,16 +124,16 @@ it("display_none_fixed_size", function () {
config.free(); config.free();
} }
}); });
it("display_none_with_margin", function () { test("display_none_with_margin", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setMargin(Yoga.EDGE_LEFT, 10); root_child0.setMargin(Yoga.EDGE_LEFT, 10);
root_child0.setMargin(Yoga.EDGE_TOP, 10); root_child0.setMargin(Yoga.EDGE_TOP, 10);
root_child0.setMargin(Yoga.EDGE_RIGHT, 10); root_child0.setMargin(Yoga.EDGE_RIGHT, 10);
@@ -143,42 +143,42 @@ it("display_none_with_margin", function () {
root_child0.setDisplay(Yoga.DISPLAY_NONE); root_child0.setDisplay(Yoga.DISPLAY_NONE);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(1); root_child1.setFlexGrow(1);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(0);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(0);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -187,93 +187,93 @@ it("display_none_with_margin", function () {
config.free(); config.free();
} }
}); });
it("display_none_with_child", function () { test("display_none_with_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root_child0.setFlexShrink(1); root_child0.setFlexShrink(1);
root_child0.setFlexBasis("0%"); root_child0.setFlexBasis("0%");
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(1); root_child1.setFlexGrow(1);
root_child1.setFlexShrink(1); root_child1.setFlexShrink(1);
root_child1.setFlexBasis("0%"); root_child1.setFlexBasis("0%");
root_child1.setDisplay(Yoga.DISPLAY_NONE); root_child1.setDisplay(Yoga.DISPLAY_NONE);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child1_child0 = Yoga.Node.create(config); const root_child1_child0 = Yoga.Node.create(config);
root_child1_child0.setFlexGrow(1); root_child1_child0.setFlexGrow(1);
root_child1_child0.setFlexShrink(1); root_child1_child0.setFlexShrink(1);
root_child1_child0.setFlexBasis("0%"); root_child1_child0.setFlexBasis("0%");
root_child1_child0.setWidth(20); root_child1_child0.setWidth(20);
root_child1.insertChild(root_child1_child0, 0); root_child1.insertChild(root_child1_child0, 0);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setFlexGrow(1); root_child2.setFlexGrow(1);
root_child2.setFlexShrink(1); root_child2.setFlexShrink(1);
root_child2.setFlexBasis("0%"); root_child2.setFlexBasis("0%");
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(50);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); expect(root_child1_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); expect(root_child1_child0.getComputedTop()).toBe(0);
console.assert(0 === root_child1_child0.getComputedWidth(), "0 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); expect(root_child1_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); expect(root_child1_child0.getComputedHeight()).toBe(0);
console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(50);
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(0);
console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(50);
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(50);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(50);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); expect(root_child1_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); expect(root_child1_child0.getComputedTop()).toBe(0);
console.assert(0 === root_child1_child0.getComputedWidth(), "0 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); expect(root_child1_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); expect(root_child1_child0.getComputedHeight()).toBe(0);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(0);
console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(50);
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -282,57 +282,57 @@ it("display_none_with_child", function () {
config.free(); config.free();
} }
}); });
it("display_none_with_position", function () { test("display_none_with_position", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(1); root_child1.setFlexGrow(1);
root_child1.setPosition(Yoga.EDGE_TOP, 10); root_child1.setPosition(Yoga.EDGE_TOP, 10);
root_child1.setDisplay(Yoga.DISPLAY_NONE); root_child1.setDisplay(Yoga.DISPLAY_NONE);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(0);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -341,15 +341,15 @@ it("display_none_with_position", function () {
config.free(); config.free();
} }
}); });
it("display_none_with_position_absolute", function () { test("display_none_with_position_absolute", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
root_child0.setWidth(100); root_child0.setWidth(100);
root_child0.setHeight(100); root_child0.setHeight(100);
@@ -357,27 +357,27 @@ it("display_none_with_position_absolute", function () {
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(0);
console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(0);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();

View File

@@ -7,67 +7,67 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html
it("flex_direction_column_no_height", function () { test("flex_direction_column_no_height", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setHeight(10); root_child1.setHeight(10);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setHeight(10); root_child2.setHeight(10);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(30);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(10);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(10);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(20);
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(100);
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(30);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(10);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(10);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(20);
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(100);
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -76,68 +76,68 @@ it("flex_direction_column_no_height", function () {
config.free(); config.free();
} }
}); });
it("flex_direction_row_no_width", function () { test("flex_direction_row_no_width", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(10); root_child0.setWidth(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setWidth(10); root_child1.setWidth(10);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setWidth(10); root_child2.setWidth(10);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(30);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(10);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(10);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(20);
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(0);
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(10);
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(30);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(20);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(10);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(10);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(0);
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(10);
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -146,68 +146,68 @@ it("flex_direction_row_no_width", function () {
config.free(); config.free();
} }
}); });
it("flex_direction_column", function () { test("flex_direction_column", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setHeight(10); root_child1.setHeight(10);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setHeight(10); root_child2.setHeight(10);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(10);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(10);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(20);
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(100);
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(10);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(10);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(20);
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(100);
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -216,69 +216,69 @@ it("flex_direction_column", function () {
config.free(); config.free();
} }
}); });
it("flex_direction_row", function () { test("flex_direction_row", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(10); root_child0.setWidth(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setWidth(10); root_child1.setWidth(10);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setWidth(10); root_child2.setWidth(10);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(10);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(10);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(20);
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(0);
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(10);
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(90);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(80 === root_child1.getComputedLeft(), "80 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(80);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(10);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
console.assert(70 === root_child2.getComputedLeft(), "70 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(70);
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(0);
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(10);
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -287,69 +287,69 @@ it("flex_direction_row", function () {
config.free(); config.free();
} }
}); });
it("flex_direction_column_reverse", function () { test("flex_direction_column_reverse", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE); root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setHeight(10); root_child1.setHeight(10);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setHeight(10); root_child2.setHeight(10);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(90 === root_child0.getComputedTop(), "90 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(90);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(80 === root_child1.getComputedTop(), "80 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(80);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(10);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(70 === root_child2.getComputedTop(), "70 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(70);
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(100);
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(90 === root_child0.getComputedTop(), "90 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(90);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(80 === root_child1.getComputedTop(), "80 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(80);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(10);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(70 === root_child2.getComputedTop(), "70 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(70);
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(100);
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -358,69 +358,69 @@ it("flex_direction_column_reverse", function () {
config.free(); config.free();
} }
}); });
it("flex_direction_row_reverse", function () { test("flex_direction_row_reverse", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(10); root_child0.setWidth(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setWidth(10); root_child1.setWidth(10);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setWidth(10); root_child2.setWidth(10);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(90);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(80 === root_child1.getComputedLeft(), "80 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(80);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(10);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
console.assert(70 === root_child2.getComputedLeft(), "70 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(70);
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(0);
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(10);
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(10);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(10);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(20);
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(0);
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(10);
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();

View File

@@ -7,55 +7,55 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html
it("flex_basis_flex_grow_column", function () { test("flex_basis_flex_grow_column", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root_child0.setFlexBasis(50); root_child0.setFlexBasis(50);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(1); root_child1.setFlexGrow(1);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(75);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(75);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(25);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(75);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(75);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(25);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -64,59 +64,59 @@ it("flex_basis_flex_grow_column", function () {
config.free(); config.free();
} }
}); });
it("flex_shrink_flex_grow_row", function () { test("flex_shrink_flex_grow_row", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(500); root.setWidth(500);
root.setHeight(500); root.setHeight(500);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexShrink(1); root_child0.setFlexShrink(1);
root_child0.setWidth(500); root_child0.setWidth(500);
root_child0.setHeight(100); root_child0.setHeight(100);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexShrink(1); root_child1.setFlexShrink(1);
root_child1.setWidth(500); root_child1.setWidth(500);
root_child1.setHeight(100); root_child1.setHeight(100);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(500);
console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(500);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(250);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(250);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(250);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(500);
console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(500);
console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(250);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(250);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(250);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -125,22 +125,22 @@ it("flex_shrink_flex_grow_row", function () {
config.free(); config.free();
} }
}); });
it("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { test("flex_shrink_flex_grow_child_flex_shrink_other_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(500); root.setWidth(500);
root.setHeight(500); root.setHeight(500);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexShrink(1); root_child0.setFlexShrink(1);
root_child0.setWidth(500); root_child0.setWidth(500);
root_child0.setHeight(100); root_child0.setHeight(100);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(1); root_child1.setFlexGrow(1);
root_child1.setFlexShrink(1); root_child1.setFlexShrink(1);
root_child1.setWidth(500); root_child1.setWidth(500);
@@ -148,37 +148,37 @@ it("flex_shrink_flex_grow_child_flex_shrink_other_child", function () {
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(500);
console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(500);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(250);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(250);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(250);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(500);
console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(500);
console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(250);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(250);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(250);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -187,56 +187,56 @@ it("flex_shrink_flex_grow_child_flex_shrink_other_child", function () {
config.free(); config.free();
} }
}); });
it("flex_basis_flex_grow_row", function () { test("flex_basis_flex_grow_row", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root_child0.setFlexBasis(50); root_child0.setFlexBasis(50);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(1); root_child1.setFlexGrow(1);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(75 === root_child0.getComputedWidth(), "75 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(75);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(75);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(25);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(25);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(75 === root_child0.getComputedWidth(), "75 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(75);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(25);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -245,55 +245,55 @@ it("flex_basis_flex_grow_row", function () {
config.free(); config.free();
} }
}); });
it("flex_basis_flex_shrink_column", function () { test("flex_basis_flex_shrink_column", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexShrink(1); root_child0.setFlexShrink(1);
root_child0.setFlexBasis(100); root_child0.setFlexBasis(100);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexBasis(50); root_child1.setFlexBasis(50);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(50);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(50);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(50);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(50);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(50);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(50);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -302,56 +302,56 @@ it("flex_basis_flex_shrink_column", function () {
config.free(); config.free();
} }
}); });
it("flex_basis_flex_shrink_row", function () { test("flex_basis_flex_shrink_row", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexShrink(1); root_child0.setFlexShrink(1);
root_child0.setFlexBasis(100); root_child0.setFlexBasis(100);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexBasis(50); root_child1.setFlexBasis(50);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(50);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(50);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(50);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(50);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(50);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(0);
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(50);
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -360,71 +360,71 @@ it("flex_basis_flex_shrink_row", function () {
config.free(); config.free();
} }
}); });
it("flex_shrink_to_zero", function () { test("flex_shrink_to_zero", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setHeight(75); root.setHeight(75);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(50); root_child0.setWidth(50);
root_child0.setHeight(50); root_child0.setHeight(50);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexShrink(1); root_child1.setFlexShrink(1);
root_child1.setWidth(50); root_child1.setWidth(50);
root_child1.setHeight(50); root_child1.setHeight(50);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setWidth(50); root_child2.setWidth(50);
root_child2.setHeight(50); root_child2.setHeight(50);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(50);
console.assert(75 === root.getComputedHeight(), "75 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(75);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(50);
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(50);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(50);
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(50);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(50);
console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(50);
console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(50);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(50);
console.assert(75 === root.getComputedHeight(), "75 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(75);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(50);
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(50);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(50);
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(50);
console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(0);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(50);
console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(50);
console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(50);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -433,72 +433,72 @@ it("flex_shrink_to_zero", function () {
config.free(); config.free();
} }
}); });
it("flex_basis_overrides_main_size", function () { test("flex_basis_overrides_main_size", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root_child0.setFlexBasis(50); root_child0.setFlexBasis(50);
root_child0.setHeight(20); root_child0.setHeight(20);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(1); root_child1.setFlexGrow(1);
root_child1.setHeight(10); root_child1.setHeight(10);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setFlexGrow(1); root_child2.setFlexGrow(1);
root_child2.setHeight(10); root_child2.setHeight(10);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(60);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(60);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(20);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(80);
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(100);
console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(20);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(60);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(60);
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(100);
console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(20);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(80);
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(100);
console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(20);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -507,54 +507,54 @@ it("flex_basis_overrides_main_size", function () {
config.free(); config.free();
} }
}); });
it("flex_grow_shrink_at_most", function () { test("flex_grow_shrink_at_most", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child0_child0 = Yoga.Node.create(config); const root_child0_child0 = Yoga.Node.create(config);
root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexGrow(1);
root_child0_child0.setFlexShrink(1); root_child0_child0.setFlexShrink(1);
root_child0.insertChild(root_child0_child0, 0); root_child0.insertChild(root_child0_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(0);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(100);
console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(0);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(100);
console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(0);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -563,69 +563,69 @@ it("flex_grow_shrink_at_most", function () {
config.free(); config.free();
} }
}); });
it("flex_grow_less_than_factor_one", function () { test("flex_grow_less_than_factor_one", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(200); root.setWidth(200);
root.setHeight(500); root.setHeight(500);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(0.2); root_child0.setFlexGrow(0.2);
root_child0.setFlexBasis(40); root_child0.setFlexBasis(40);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child1 = Yoga.Node.create(config); const root_child1 = Yoga.Node.create(config);
root_child1.setFlexGrow(0.2); root_child1.setFlexGrow(0.2);
root.insertChild(root_child1, 1); root.insertChild(root_child1, 1);
var root_child2 = Yoga.Node.create(config); const root_child2 = Yoga.Node.create(config);
root_child2.setFlexGrow(0.4); root_child2.setFlexGrow(0.4);
root.insertChild(root_child2, 2); root.insertChild(root_child2, 2);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(200);
console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(500);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(200);
console.assert(132 === root_child0.getComputedHeight(), "132 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(132);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(132 === root_child1.getComputedTop(), "132 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(132);
console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(200);
console.assert(92 === root_child1.getComputedHeight(), "92 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(92);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(224 === root_child2.getComputedTop(), "224 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(224);
console.assert(200 === root_child2.getComputedWidth(), "200 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(200);
console.assert(184 === root_child2.getComputedHeight(), "184 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(184);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(200);
console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(500);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(200);
console.assert(132 === root_child0.getComputedHeight(), "132 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(132);
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); expect(root_child1.getComputedLeft()).toBe(0);
console.assert(132 === root_child1.getComputedTop(), "132 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); expect(root_child1.getComputedTop()).toBe(132);
console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); expect(root_child1.getComputedWidth()).toBe(200);
console.assert(92 === root_child1.getComputedHeight(), "92 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); expect(root_child1.getComputedHeight()).toBe(92);
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); expect(root_child2.getComputedLeft()).toBe(0);
console.assert(224 === root_child2.getComputedTop(), "224 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); expect(root_child2.getComputedTop()).toBe(224);
console.assert(200 === root_child2.getComputedWidth(), "200 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); expect(root_child2.getComputedWidth()).toBe(200);
console.assert(184 === root_child2.getComputedHeight(), "184 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); expect(root_child2.getComputedHeight()).toBe(184);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -7,28 +7,28 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html
it("padding_no_size", function () { test("padding_no_size", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_LEFT, 10);
root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_TOP, 10);
root.setPadding(Yoga.EDGE_RIGHT, 10); root.setPadding(Yoga.EDGE_RIGHT, 10);
root.setPadding(Yoga.EDGE_BOTTOM, 10); root.setPadding(Yoga.EDGE_BOTTOM, 10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(20);
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(20);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(20);
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(20);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -37,43 +37,43 @@ it("padding_no_size", function () {
config.free(); config.free();
} }
}); });
it("padding_container_match_child", function () { test("padding_container_match_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_LEFT, 10);
root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_TOP, 10);
root.setPadding(Yoga.EDGE_RIGHT, 10); root.setPadding(Yoga.EDGE_RIGHT, 10);
root.setPadding(Yoga.EDGE_BOTTOM, 10); root.setPadding(Yoga.EDGE_BOTTOM, 10);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(10); root_child0.setWidth(10);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(30);
console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(30);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(30);
console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(30);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -82,11 +82,11 @@ it("padding_container_match_child", function () {
config.free(); config.free();
} }
}); });
it("padding_flex_child", function () { test("padding_flex_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_LEFT, 10);
root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_TOP, 10);
root.setPadding(Yoga.EDGE_RIGHT, 10); root.setPadding(Yoga.EDGE_RIGHT, 10);
@@ -94,33 +94,33 @@ it("padding_flex_child", function () {
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setFlexGrow(1); root_child0.setFlexGrow(1);
root_child0.setWidth(10); root_child0.setWidth(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(80);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(80);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(80);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -129,11 +129,11 @@ it("padding_flex_child", function () {
config.free(); config.free();
} }
}); });
it("padding_stretch_child", function () { test("padding_stretch_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_LEFT, 10);
root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_TOP, 10);
root.setPadding(Yoga.EDGE_RIGHT, 10); root.setPadding(Yoga.EDGE_RIGHT, 10);
@@ -141,32 +141,32 @@ it("padding_stretch_child", function () {
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(80);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(10);
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(10);
console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(80);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -175,11 +175,11 @@ it("padding_stretch_child", function () {
config.free(); config.free();
} }
}); });
it("padding_center_child", function () { test("padding_center_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setJustifyContent(Yoga.JUSTIFY_CENTER);
root.setAlignItems(Yoga.ALIGN_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER);
root.setPadding(Yoga.EDGE_START, 10); root.setPadding(Yoga.EDGE_START, 10);
@@ -188,33 +188,33 @@ it("padding_center_child", function () {
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(10); root_child0.setWidth(10);
root_child0.setHeight(10); root_child0.setHeight(10);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(40);
console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(35);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(50);
console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(35);
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(10);
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(10);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -223,17 +223,17 @@ it("padding_center_child", function () {
config.free(); config.free();
} }
}); });
it("child_with_padding_align_end", function () { test("child_with_padding_align_end", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setAlignItems(Yoga.ALIGN_FLEX_END);
root.setWidth(200); root.setWidth(200);
root.setHeight(200); root.setHeight(200);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setPadding(Yoga.EDGE_LEFT, 20); root_child0.setPadding(Yoga.EDGE_LEFT, 20);
root_child0.setPadding(Yoga.EDGE_TOP, 20); root_child0.setPadding(Yoga.EDGE_TOP, 20);
root_child0.setPadding(Yoga.EDGE_RIGHT, 20); root_child0.setPadding(Yoga.EDGE_RIGHT, 20);
@@ -243,27 +243,27 @@ it("child_with_padding_align_end", function () {
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(200);
console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(200);
console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(100);
console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(100);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(200);
console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(200);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(100);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -7,54 +7,54 @@
// @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html
it("nested_overflowing_child", function () { test("nested_overflowing_child", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child0_child0 = Yoga.Node.create(config); const root_child0_child0 = Yoga.Node.create(config);
root_child0_child0.setWidth(200); root_child0_child0.setWidth(200);
root_child0_child0.setHeight(200); root_child0_child0.setHeight(200);
root_child0.insertChild(root_child0_child0, 0); root_child0.insertChild(root_child0_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(200);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(200);
console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(200);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(200);
console.assert(-100 === root_child0_child0.getComputedLeft(), "-100 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(-100);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(200);
console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(200);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -63,56 +63,56 @@ it("nested_overflowing_child", function () {
config.free(); config.free();
} }
}); });
it("nested_overflowing_child_in_constraint_parent", function () { test("nested_overflowing_child_in_constraint_parent", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(100); root_child0.setWidth(100);
root_child0.setHeight(100); root_child0.setHeight(100);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child0_child0 = Yoga.Node.create(config); const root_child0_child0 = Yoga.Node.create(config);
root_child0_child0.setWidth(200); root_child0_child0.setWidth(200);
root_child0_child0.setHeight(200); root_child0_child0.setHeight(200);
root_child0.insertChild(root_child0_child0, 0); root_child0.insertChild(root_child0_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(200);
console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(200);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(100);
console.assert(-100 === root_child0_child0.getComputedLeft(), "-100 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(-100);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(200);
console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(200);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();
@@ -121,55 +121,55 @@ it("nested_overflowing_child_in_constraint_parent", function () {
config.free(); config.free();
} }
}); });
it("parent_wrap_child_size_overflowing_parent", function () { test("parent_wrap_child_size_overflowing_parent", function () {
var config = Yoga.Config.create(); const config = Yoga.Config.create();
try { try {
var root = Yoga.Node.create(config); const root = Yoga.Node.create(config);
root.setWidth(100); root.setWidth(100);
root.setHeight(100); root.setHeight(100);
var root_child0 = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config);
root_child0.setWidth(100); root_child0.setWidth(100);
root.insertChild(root_child0, 0); root.insertChild(root_child0, 0);
var root_child0_child0 = Yoga.Node.create(config); const root_child0_child0 = Yoga.Node.create(config);
root_child0_child0.setWidth(100); root_child0_child0.setWidth(100);
root_child0_child0.setHeight(200); root_child0_child0.setHeight(200);
root_child0.insertChild(root_child0_child0, 0); root_child0.insertChild(root_child0_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(200);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(100);
console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(200);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); expect(root.getComputedLeft()).toBe(0);
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); expect(root.getComputedTop()).toBe(0);
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); expect(root.getComputedWidth()).toBe(100);
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); expect(root.getComputedHeight()).toBe(100);
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); expect(root_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); expect(root_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); expect(root_child0.getComputedWidth()).toBe(100);
console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); expect(root_child0.getComputedHeight()).toBe(200);
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); expect(root_child0_child0.getComputedLeft()).toBe(0);
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); expect(root_child0_child0.getComputedTop()).toBe(0);
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); expect(root_child0_child0.getComputedWidth()).toBe(100);
console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); expect(root_child0_child0.getComputedHeight()).toBe(200);
} finally { } finally {
if (typeof root !== "undefined") { if (typeof root !== "undefined") {
root.freeRecursive(); root.freeRecursive();