mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 23:30:37 +01:00
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
#include <quiz.h>
|
|
#include <ion.h>
|
|
#include <poincare_layouts.h>
|
|
#include <assert.h>
|
|
#include "helper.h"
|
|
|
|
using namespace Poincare;
|
|
|
|
QUIZ_CASE(poincare_parenthesis_layout_size) {
|
|
/* 3
|
|
* (2+(---)6)1
|
|
* 4
|
|
* Assert that the first and last parentheses have the same size.
|
|
*/
|
|
HorizontalLayout * layout = new HorizontalLayout();
|
|
LeftParenthesisLayout leftPar = new LeftParenthesisLayout();
|
|
RightParenthesisLayout rightPar = new RightParenthesisLayout();
|
|
layout->addChildTreeAtIndex(leftPar, 0);
|
|
layout->addChildTreeAtIndex(new CharLayout('2'), 1);
|
|
layout->addChildTreeAtIndex(new CharLayout('+'), 2);
|
|
layout->addChildTreeAtIndex(new LeftParenthesisLayout(), 3);
|
|
layout->addChildTreeAtIndex(new FractionLayout(
|
|
new CharLayout('3'),
|
|
new CharLayout('4')),
|
|
4);
|
|
layout->addChildTreeAtIndex(new RightParenthesisLayout(), 3);
|
|
layout->addChildTreeAtIndex(new CharLayout('6'), 5);
|
|
layout->addChildTreeAtIndex(rightPar, 7);
|
|
layout->addChildTreeAtIndex(new CharLayout('1'), 8);
|
|
assert(leftPar->size().height() == rightPar->size().height());
|
|
delete layout;
|
|
}
|