From 059384f2770aa9e30c22000c0833b8ae65170a45 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Wed, 31 Aug 2016 11:07:26 -0700 Subject: [PATCH] Improve formatting of generated test code input Summary: Make input html easier to read by indenting it and adding a space between children. The code to do this could very well be improved but it works for the current set of inputs. Reviewed By: lucasr Differential Revision: D3798087 fbshipit-source-id: 0d50ff276000f14ed078cf5ce2e7560ace285a6a --- gentest/gentest.js | 16 +++++- tests/CSSLayoutAbsolutePositionTest.cpp | 18 ++++--- tests/CSSLayoutAlignContentTest.cpp | 43 ++++++++------- tests/CSSLayoutAlignItemsTest.cpp | 11 ++-- tests/CSSLayoutAlignSelfTest.cpp | 11 ++-- tests/CSSLayoutFlexDirectionTest.cpp | 41 ++++++++------- tests/CSSLayoutFlexTest.cpp | 24 +++++---- tests/CSSLayoutFlexWrapTest.cpp | 17 +++--- tests/CSSLayoutJustifyContentTest.cpp | 69 ++++++++++++++----------- tests/CSSLayoutMinMaxDimensionTest.cpp | 15 +++--- 10 files changed, 157 insertions(+), 108 deletions(-) diff --git a/gentest/gentest.js b/gentest/gentest.js index 9e5273b4..a4b43ed6 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -27,13 +27,27 @@ function printTest(rootNode, layoutTree) { lines.push('/**'); lines.push(' * @Generated by gentest/gentest.sh with the following input'); lines.push(' *'); + + var indentation = 0; lines.push(rootNode.innerHTML.split('\n').map(function(line) { return line.trim(); }).filter(function(line) { return line.length > 0 && line !== '
'; }).map(function(line) { - return ' * ' + line; + var result; + if (line.indexOf(' - *
+ *
* + * *
- *
+ *
*
+ * *
- *
+ *
*
+ * *
- *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
* */ diff --git a/tests/CSSLayoutAlignContentTest.cpp b/tests/CSSLayoutAlignContentTest.cpp index 72d489be..92ae9a9c 100644 --- a/tests/CSSLayoutAlignContentTest.cpp +++ b/tests/CSSLayoutAlignContentTest.cpp @@ -11,32 +11,35 @@ * @Generated by gentest/gentest.sh with the following input * *
- *
- *
- *
- *
- *
+ *
+ *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
- *
- *
+ *
+ *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
- *
- *
+ *
+ *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
- *
- *
+ *
+ *
+ *
+ *
+ *
*
* */ diff --git a/tests/CSSLayoutAlignItemsTest.cpp b/tests/CSSLayoutAlignItemsTest.cpp index 7e68ee01..8ef07639 100644 --- a/tests/CSSLayoutAlignItemsTest.cpp +++ b/tests/CSSLayoutAlignItemsTest.cpp @@ -11,16 +11,19 @@ * @Generated by gentest/gentest.sh with the following input * *
- *
+ *
*
+ * *
- *
+ *
*
+ * *
- *
+ *
*
+ * *
- *
+ *
*
* */ diff --git a/tests/CSSLayoutAlignSelfTest.cpp b/tests/CSSLayoutAlignSelfTest.cpp index 86471ed4..cf28ce5f 100644 --- a/tests/CSSLayoutAlignSelfTest.cpp +++ b/tests/CSSLayoutAlignSelfTest.cpp @@ -11,16 +11,19 @@ * @Generated by gentest/gentest.sh with the following input * *
- *
+ *
*
+ * *
- *
+ *
*
+ * *
- *
+ *
*
+ * *
- *
+ *
*
* */ diff --git a/tests/CSSLayoutFlexDirectionTest.cpp b/tests/CSSLayoutFlexDirectionTest.cpp index 68162127..a2578762 100644 --- a/tests/CSSLayoutFlexDirectionTest.cpp +++ b/tests/CSSLayoutFlexDirectionTest.cpp @@ -11,34 +11,39 @@ * @Generated by gentest/gentest.sh with the following input * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
* */ diff --git a/tests/CSSLayoutFlexTest.cpp b/tests/CSSLayoutFlexTest.cpp index 588ed0e6..c49c3869 100644 --- a/tests/CSSLayoutFlexTest.cpp +++ b/tests/CSSLayoutFlexTest.cpp @@ -11,24 +11,28 @@ * @Generated by gentest/gentest.sh with the following input * *
- *
- *
+ *
+ *
*
+ * *
- *
- *
+ *
+ *
*
+ * *
- *
- *
+ *
+ *
*
+ * *
- *
- *
+ *
+ *
*
+ * *
- *
- *
+ *
+ *
*
* */ diff --git a/tests/CSSLayoutFlexWrapTest.cpp b/tests/CSSLayoutFlexWrapTest.cpp index 0f388539..7bb85aba 100644 --- a/tests/CSSLayoutFlexWrapTest.cpp +++ b/tests/CSSLayoutFlexWrapTest.cpp @@ -11,16 +11,17 @@ * @Generated by gentest/gentest.sh with the following input * *
- *
- *
- *
- *
+ *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
- *
+ *
+ *
+ *
+ *
*
* */ diff --git a/tests/CSSLayoutJustifyContentTest.cpp b/tests/CSSLayoutJustifyContentTest.cpp index f3e31b82..89ac9f25 100644 --- a/tests/CSSLayoutJustifyContentTest.cpp +++ b/tests/CSSLayoutJustifyContentTest.cpp @@ -11,54 +11,63 @@ * @Generated by gentest/gentest.sh with the following input * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
+ * *
- *
- *
- *
+ *
+ *
+ *
*
* */ diff --git a/tests/CSSLayoutMinMaxDimensionTest.cpp b/tests/CSSLayoutMinMaxDimensionTest.cpp index 69316d01..065d9c0a 100644 --- a/tests/CSSLayoutMinMaxDimensionTest.cpp +++ b/tests/CSSLayoutMinMaxDimensionTest.cpp @@ -11,18 +11,21 @@ * @Generated by gentest/gentest.sh with the following input * *
- *
+ *
*
+ * *
- *
+ *
*
+ * *
- *
- *
+ *
+ *
*
+ * *
- *
- *
+ *
+ *
*
* */