mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
Fix spelling (#128)
* Fix spelling in .cpp files * Fix spelling in all files
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "execution_environment.h"
|
||||
|
||||
QUIZ_CASE(python_basics) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "2+3","5\n");
|
||||
deinit_environment();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ bool execute_input(TestExecutionEnvironment env, bool singleCommandLine, const c
|
||||
return executionResult;
|
||||
}
|
||||
|
||||
TestExecutionEnvironment init_environement() {
|
||||
TestExecutionEnvironment init_environnement() {
|
||||
MicroPython::init(TestExecutionEnvironment::s_pythonHeap, TestExecutionEnvironment::s_pythonHeap + TestExecutionEnvironment::s_pythonHeapSize);
|
||||
return TestExecutionEnvironment();
|
||||
}
|
||||
@@ -61,7 +61,7 @@ void deinit_environment() {
|
||||
}
|
||||
|
||||
void assert_script_execution_result(bool expectedResult, const char * script, const char * outputText = nullptr) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
quiz_assert(expectedResult == execute_input(env, false, script, outputText));
|
||||
deinit_environment();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ private:
|
||||
size_t m_printTextIndex;
|
||||
};
|
||||
|
||||
TestExecutionEnvironment init_environement();
|
||||
TestExecutionEnvironment init_environnement();
|
||||
void deinit_environment();
|
||||
|
||||
void assert_script_execution_succeeds(const char * script, const char * outputText = nullptr);
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
QUIZ_CASE(python_ion_import) {
|
||||
// Test "from ion import *"
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_fails(env, "keydown(KEY_LEFT)");
|
||||
assert_command_execution_succeeds(env, "from ion import *");
|
||||
assert_command_execution_succeeds(env, "keydown(KEY_LEFT)");
|
||||
deinit_environment();
|
||||
|
||||
// "import ion"
|
||||
env = init_environement();
|
||||
env = init_environnement();
|
||||
assert_command_execution_fails(env, "ion.keydown(ion.KEY_LEFT)");
|
||||
assert_command_execution_succeeds(env, "import ion");
|
||||
assert_command_execution_succeeds(env, "ion.keydown(ion.KEY_LEFT)");
|
||||
@@ -18,7 +18,7 @@ QUIZ_CASE(python_ion_import) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_ion_keydown) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from ion import *");
|
||||
assert_command_execution_succeeds(env, "keydown(KEY_LEFT)", "False\n");
|
||||
deinit_environment();
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
QUIZ_CASE(python_kandinsky_import) {
|
||||
// Test "from kandinsky import *"
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_fails(env, "get_pixel(0,0)");
|
||||
assert_command_execution_succeeds(env, "from kandinsky import *");
|
||||
assert_command_execution_succeeds(env, "get_pixel(0,0)");
|
||||
deinit_environment();
|
||||
|
||||
// "import kandinsky"
|
||||
env = init_environement();
|
||||
env = init_environnement();
|
||||
assert_command_execution_fails(env, "kandinsky.get_pixel(0,0)");
|
||||
assert_command_execution_succeeds(env, "import kandinsky");
|
||||
assert_command_execution_succeeds(env, "kandinsky.get_pixel(0,0)");
|
||||
@@ -18,7 +18,7 @@ QUIZ_CASE(python_kandinsky_import) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_kandinsky_basics) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from kandinsky import *");
|
||||
assert_command_execution_succeeds(env, "set_pixel(0,0,color(12,12,12))");
|
||||
assert_command_execution_succeeds(env, "get_pixel(0,0)");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "execution_environment.h"
|
||||
|
||||
QUIZ_CASE(python_math) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from math import *");
|
||||
assert_command_execution_succeeds(env, "e", "2.718281828459045\n");
|
||||
assert_command_execution_succeeds(env, "gamma(3)", "2.0\n");
|
||||
@@ -10,7 +10,7 @@ QUIZ_CASE(python_math) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_cmath) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from cmath import *");
|
||||
assert_command_execution_succeeds(env, "cos(0)", "(1+-0j)\n");
|
||||
deinit_environment();
|
||||
|
||||
@@ -3,28 +3,28 @@
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_import) {
|
||||
// Test "from matplotlib.pyplot import *"
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_fails(env, "arrow(2,3,4,5)");
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "arrow(2,3,4,5)");
|
||||
deinit_environment();
|
||||
|
||||
// "from matplotlib import *"
|
||||
env = init_environement();
|
||||
env = init_environnement();
|
||||
assert_command_execution_fails(env, "pyplot.arrow(2,3,4,5)");
|
||||
assert_command_execution_succeeds(env, "from matplotlib import *");
|
||||
assert_command_execution_succeeds(env, "pyplot.arrow(2,3,4,5)");
|
||||
deinit_environment();
|
||||
|
||||
// "import matplotlib"
|
||||
env = init_environement();
|
||||
env = init_environnement();
|
||||
assert_command_execution_fails(env, "matplotlib.pyplot.arrow(2,3,4,5)");
|
||||
assert_command_execution_succeeds(env, "import matplotlib");
|
||||
assert_command_execution_succeeds(env, "matplotlib.pyplot.arrow(2,3,4,5)");
|
||||
deinit_environment();
|
||||
|
||||
// "import matplotlib.pyplot"
|
||||
env = init_environement();
|
||||
env = init_environnement();
|
||||
assert_command_execution_fails(env, "matplotlib.pyplot.arrow(2,3,4,5)");
|
||||
assert_command_execution_succeeds(env, "import matplotlib.pyplot");
|
||||
assert_command_execution_succeeds(env, "matplotlib.pyplot.arrow(2,3,4,5)");
|
||||
@@ -32,7 +32,7 @@ QUIZ_CASE(python_matplotlib_pyplot_import) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_arrow) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "arrow(2,3,4,5)");
|
||||
assert_command_execution_fails(env, "arrow(2,3,4,5, 0.1)");
|
||||
@@ -45,7 +45,7 @@ QUIZ_CASE(python_matplotlib_pyplot_arrow) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_axis) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "axis((2,3,4,5))");
|
||||
assert_command_execution_succeeds(env, "axis([2,3,4,5])");
|
||||
@@ -57,7 +57,7 @@ QUIZ_CASE(python_matplotlib_pyplot_axis) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_bar) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "bar([0,2,3],[10,12,23])");
|
||||
assert_command_execution_succeeds(env, "bar([0,2,3],10)");
|
||||
@@ -71,7 +71,7 @@ QUIZ_CASE(python_matplotlib_pyplot_bar) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_grid) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "grid(True)");
|
||||
assert_command_execution_succeeds(env, "grid()");
|
||||
@@ -79,7 +79,7 @@ QUIZ_CASE(python_matplotlib_pyplot_grid) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_hist) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "hist([2,3,4,5,6])");
|
||||
assert_command_execution_succeeds(env, "hist([2,3,4,5,6],23)");
|
||||
@@ -91,7 +91,7 @@ QUIZ_CASE(python_matplotlib_pyplot_hist) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_plot) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "plot([2,3,4,5,6])");
|
||||
assert_command_execution_succeeds(env, "plot(2,3)");
|
||||
@@ -103,7 +103,7 @@ QUIZ_CASE(python_matplotlib_pyplot_plot) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_scatter) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "scatter(2,3)");
|
||||
assert_command_execution_succeeds(env, "scatter([2,3,4,5,6],[3,4,5,6,7])");
|
||||
@@ -114,7 +114,7 @@ QUIZ_CASE(python_matplotlib_pyplot_scatter) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(python_matplotlib_pyplot_text) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
|
||||
assert_command_execution_succeeds(env, "text(2,3,'hello')");
|
||||
assert_command_execution_succeeds(env, "show()");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "execution_environment.h"
|
||||
|
||||
QUIZ_CASE(python_random) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_fails(env, "random()");
|
||||
assert_command_execution_succeeds(env, "from random import *");
|
||||
assert_command_execution_succeeds(env, "random()");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "execution_environment.h"
|
||||
|
||||
QUIZ_CASE(python_time) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_fails(env, "monotonic()");
|
||||
assert_command_execution_succeeds(env, "from time import *");
|
||||
assert_command_execution_succeeds(env, "monotonic()");
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// TODO: to be completed
|
||||
|
||||
QUIZ_CASE(python_turtle) {
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_fails(env, "forward(3)");
|
||||
assert_command_execution_succeeds(env, "from turtle import *");
|
||||
assert_command_execution_succeeds(env, "reset()");
|
||||
@@ -28,7 +28,7 @@ QUIZ_CASE(python_turtle) {
|
||||
|
||||
QUIZ_CASE(python_turtle_circle) {
|
||||
// Turtle position should be unchanged after a complete circle
|
||||
TestExecutionEnvironment env = init_environement();
|
||||
TestExecutionEnvironment env = init_environnement();
|
||||
assert_command_execution_succeeds(env, "from turtle import *");
|
||||
assert_command_execution_succeeds(env, "goto(0,0)");
|
||||
assert_command_execution_succeeds(env, "circle(28)");
|
||||
|
||||
Reference in New Issue
Block a user