diff --git a/src/backends/octave/testoctave.cpp b/src/backends/octave/testoctave.cpp index 2d76b5fe..fb54b7a2 100644 --- a/src/backends/octave/testoctave.cpp +++ b/src/backends/octave/testoctave.cpp @@ -1,261 +1,221 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2009 Alexander Rieder */ #include "testoctave.h" #include "session.h" #include "backend.h" #include "expression.h" #include "result.h" #include "imageresult.h" #include "textresult.h" #include "epsresult.h" #include "completionobject.h" #include "defaultvariablemodel.h" #include "octaveexpression.h" #include QString TestOctave::backendName() { return QLatin1String("octave"); } void TestOctave::testSimpleCommand() { Cantor::Expression* e=evalExp( QLatin1String("2+2") ); QVERIFY( e!=nullptr ); QVERIFY( e->result()!=nullptr ); QCOMPARE( cleanOutput( e->result()->toHtml() ), QLatin1String("ans = 4") ); } void TestOctave::testMultilineCommand() { Cantor::Expression* e=evalExp( QLatin1String("a = 2+2, b = 3+3") ); QVERIFY( e!=nullptr ); QVERIFY( e->result()!=nullptr ); QString result=e->result()->toHtml(); QCOMPARE( cleanOutput(result ), QLatin1String("a = 4\nb = 6") ); } void TestOctave::testCommandQueue() { Cantor::Expression* e1=session()->evaluateExpression(QLatin1String("0+1")); Cantor::Expression* e2=session()->evaluateExpression(QLatin1String("1+1")); Cantor::Expression* e3=evalExp(QLatin1String("1+2")); QVERIFY(e1!=nullptr); QVERIFY(e2!=nullptr); QVERIFY(e3!=nullptr); QVERIFY(e1->result()); QVERIFY(e2->result()); QVERIFY(e3->result()); QCOMPARE(cleanOutput(e1->result()->toHtml()), QLatin1String("ans = 1")); QCOMPARE(cleanOutput(e2->result()->toHtml()), QLatin1String("ans = 2")); QCOMPARE(cleanOutput(e3->result()->toHtml()), QLatin1String("ans = 3")); } void TestOctave::testVariableDefinition() { Cantor::Expression* e = evalExp(QLatin1String("testvar = 1")); QVERIFY(e != nullptr); QVERIFY(e->result() != nullptr); QCOMPARE(cleanOutput(e->result()->toHtml()), QLatin1String("testvar = 1")); } void TestOctave::testMatrixDefinition() { Cantor::Expression* e = evalExp(QLatin1String( "M = [1, 2, 3;"\ " 4, 5, 6;"\ " 7, 8, 9;]" )); QVERIFY(e != nullptr); QVERIFY(e->result() != nullptr); QCOMPARE(e->result()->type(), (int) Cantor::TextResult::Type); Cantor::TextResult* result = static_cast(e->result()); QCOMPARE(result->plain(), QLatin1String( "M =\n"\ "\n" " 1 2 3\n"\ " 4 5 6\n"\ " 7 8 9" )); } void TestOctave::testSimpleExpressionWithComment() { Cantor::Expression* e = evalExp(QLatin1String("s = 1234 #This is comment")); QVERIFY(e != nullptr); QVERIFY(e->result() != nullptr); QCOMPARE(cleanOutput(e->result()->toHtml()), QLatin1String("s = 1234")); } void TestOctave::testCommentExpression() { // https://bugs.kde.org/show_bug.cgi?id=401893 QSKIP("Skip, until we fix the bug #401893"); Cantor::Expression* e = evalExp(QLatin1String("#Only comment")); QVERIFY(e != nullptr); QCOMPARE(e->status(), Cantor::Expression::Status::Done); QCOMPARE(e->results().size(), 0); } void TestOctave::testCompletion() { QSKIP("Skip, until solve strange fail of this test with anomaly output (double prompt with missing command)"); Cantor::CompletionObject* help = session()->completionFor(QLatin1String("as"), 2); waitForSignal(help, SIGNAL(fetchingDone())); // Checks some completions for this request (but not all) // This correct for Octave 4.2.2 at least (and another versions, I think) const QStringList& completions = help->completions(); qDebug() << completions; QVERIFY(completions.contains(QLatin1String("asin"))); QVERIFY(completions.contains(QLatin1String("asctime"))); QVERIFY(completions.contains(QLatin1String("asec"))); QVERIFY(completions.contains(QLatin1String("assert"))); } void TestOctave::testVariablesCreatingFromCode() { QAbstractItemModel* model = session()->variableModel(); QVERIFY(model != nullptr); evalExp(QLatin1String("clear();")); Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); QVERIFY(e!=nullptr); if(session()->status()==Cantor::Session::Running) waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); QCOMPARE(2, model->rowCount()); QCOMPARE(model->index(0,0).data().toString(), QLatin1String("a")); QCOMPARE(model->index(0,1).data().toString(), QLatin1String(" 15")); QCOMPARE(model->index(1,0).data().toString(), QLatin1String("b")); QCOMPARE(model->index(1,1).data().toString(), QLatin1String("S")); } -void TestOctave::testVariablesCreatingFromManager() -{ - Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); - QVERIFY(model != nullptr); - - evalExp(QLatin1String("clear();")); - - model->addVariable(QLatin1String("a"), QLatin1String("15")); - model->addVariable(QLatin1String("b"), QLatin1String("Q")); - - QCOMPARE(2, static_cast(model)->rowCount()); - - QCOMPARE(model->index(0,0).data().toString(), QLatin1String("a")); - QCOMPARE(model->index(0,1).data().toString(), QLatin1String("15")); - - QCOMPARE(model->index(1,0).data().toString(), QLatin1String("b")); - QCOMPARE(model->index(1,1).data().toString(), QLatin1String("Q")); -} - -void TestOctave::testVariableRemoving() -{ - Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); - QVERIFY(model != nullptr); - - evalExp(QLatin1String("clear();")); - Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); - QVERIFY(e!=nullptr); - - if(session()->status()==Cantor::Session::Running) - waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); - - QCOMPARE(2, static_cast(model)->rowCount()); - - model->removeVariable(QLatin1String("a")); - - QCOMPARE(1, static_cast(model)->rowCount()); - QCOMPARE(model->index(0,0).data().toString(), QLatin1String("b")); - QCOMPARE(model->index(0,1).data().toString(), QLatin1String("S")); -} - void TestOctave::testVariableCleanupAfterRestart() { Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); QVERIFY(model != nullptr); evalExp(QLatin1String("clear();")); Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); QVERIFY(e!=nullptr); if(session()->status()==Cantor::Session::Running) waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); QCOMPARE(2, static_cast(model)->rowCount()); session()->logout(); session()->login(); QCOMPARE(0, static_cast(model)->rowCount()); } void TestOctave::testPlot() { Cantor::Expression* e=evalExp( QLatin1String("cantor_plot2d('sin(x)', 'x', -10,10);") ); int cnt=0; //give some time to create the image, but at most 5sec while(e->result()==nullptr||e->result()->type()!=OctavePlotResult::Type ) { QTest::qWait(250); cnt+=250; if(cnt>5000) break; } QVERIFY( e!=nullptr ); QVERIFY( e->result()!=nullptr ); QCOMPARE( e->result()->type(), (int) OctavePlotResult::Type ); QVERIFY( !e->result()->data().isNull() ); } void TestOctave::testInvalidSyntax() { Cantor::Expression* e=evalExp( QLatin1String("2+2*+.") ); QVERIFY( e!=nullptr ); QCOMPARE( e->status(), Cantor::Expression::Error ); } QTEST_MAIN( TestOctave ) diff --git a/src/backends/octave/testoctave.h b/src/backends/octave/testoctave.h index 2818e412..7a2d9234 100644 --- a/src/backends/octave/testoctave.h +++ b/src/backends/octave/testoctave.h @@ -1,70 +1,68 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2009 Alexander Rieder */ #ifndef _TESTOCTAVE_H #define _TESTOCTAVE_H #include "backendtest.h" /** This class test some of the basic functions of the Octave backend The different tests represent some general expressions, as well as expressions, that are known to have caused problems in earlier versions **/ class TestOctave : public BackendTest { Q_OBJECT private Q_SLOTS: //tests evaluating a simple command void testSimpleCommand(); //tests a command, containing more than 1 line void testMultilineCommand(); //tests if the command queue works correcly void testCommandQueue(); void testVariableDefinition(); void testMatrixDefinition(); //some tests to see if comments are working correctly void testSimpleExpressionWithComment(); void testCommentExpression(); //tests a syntax error (not closing bracket) void testInvalidSyntax(); void testCompletion(); //tests variable model void testVariablesCreatingFromCode(); - void testVariablesCreatingFromManager(); - void testVariableRemoving(); void testVariableCleanupAfterRestart(); //tests doing a plot void testPlot(); private: QString backendName() override; }; #endif /* _TESTOCTAVE_H */ diff --git a/src/backends/python2/testpython2.cpp b/src/backends/python2/testpython2.cpp index 61486d9f..63b724c2 100644 --- a/src/backends/python2/testpython2.cpp +++ b/src/backends/python2/testpython2.cpp @@ -1,192 +1,151 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2013 Tuukka Verho */ #include "testpython2.h" #include "session.h" #include "backend.h" #include "expression.h" #include "result.h" #include "defaultvariablemodel.h" QString TestPython2::backendName() { return QLatin1String("python2"); } void TestPython2::testImportNumpy() { Cantor::Expression* e = evalExp(QLatin1String("import numpy")); QVERIFY(e != nullptr); QCOMPARE(e->status(), Cantor::Expression::Done); } void TestPython2::testCodeWithComments() { { Cantor::Expression* e = evalExp(QLatin1String("#comment\n1+2")); QVERIFY(e != nullptr); QVERIFY(e->result()->data().toString() == QLatin1String("3")); } { Cantor::Expression* e = evalExp(QLatin1String(" #comment\n1+2")); QVERIFY(e != nullptr); QVERIFY(e->result()->data().toString() == QLatin1String("3")); } } void TestPython2::testSimpleCode() { Cantor::Expression* e=evalExp( QLatin1String("2+2")); QVERIFY( e!=nullptr ); QVERIFY( e->result()!=nullptr ); QString result=e->result()->toHtml(); QCOMPARE( cleanOutput(result ), QLatin1String("4") ); } void TestPython2::testMultilineCode() { Cantor::Expression* e=evalExp(QLatin1String( "a = 2+2\n" "b = 3+3\n" "print a,b" )); QVERIFY( e!=nullptr ); QVERIFY( e->result()!=nullptr ); QString result=e->result()->toHtml(); QCOMPARE( cleanOutput(result ), QLatin1String("4 6") ); evalExp(QLatin1String("del a; del b")); } void TestPython2::testVariablesCreatingFromCode() { QAbstractItemModel* model = session()->variableModel(); QVERIFY(model != nullptr); Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); QVERIFY(e!=nullptr); if(session()->status()==Cantor::Session::Running) waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); QCOMPARE(2, model->rowCount()); QCOMPARE(model->index(0,0).data().toString(), QLatin1String("a")); QCOMPARE(model->index(0,1).data().toString(), QLatin1String("15")); QCOMPARE(model->index(1,0).data().toString(), QLatin1String("b")); QCOMPARE(model->index(1,1).data().toString(), QLatin1String("'S'")); evalExp(QLatin1String("del a; del b")); } -void TestPython2::testVariablesCreatingFromManager() -{ - Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); - QVERIFY(model != nullptr); - - model->addVariable(QLatin1String("a"), QLatin1String("15")); - model->addVariable(QLatin1String("b"), QLatin1String("'Q'")); - - QCOMPARE(2, static_cast(model)->rowCount()); - - QCOMPARE(model->index(0,0).data().toString(), QLatin1String("a")); - QCOMPARE(model->index(0,1).data().toString(), QLatin1String("15")); - - QCOMPARE(model->index(1,0).data().toString(), QLatin1String("b")); - QCOMPARE(model->index(1,1).data().toString(), QLatin1String("'Q'")); - - evalExp(QLatin1String("del a; del b")); -} - -void TestPython2::testVariableRemoving() -{ - Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); - QVERIFY(model != nullptr); - - Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); - QVERIFY(e!=nullptr); - - if(session()->status()==Cantor::Session::Running) - waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); - - QCOMPARE(2, static_cast(model)->rowCount()); - - model->removeVariable(QLatin1String("a")); - - QCOMPARE(1, static_cast(model)->rowCount()); - QCOMPARE(model->index(0,0).data().toString(), QLatin1String("b")); - QCOMPARE(model->index(0,1).data().toString(), QLatin1String("'S'")); - - evalExp(QLatin1String("del b")); -} - void TestPython2::testVariableCleanupAfterRestart() { Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); QVERIFY(model != nullptr); Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); QVERIFY(e!=nullptr); if(session()->status()==Cantor::Session::Running) waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); QCOMPARE(2, static_cast(model)->rowCount()); session()->logout(); session()->login(); QCOMPARE(0, static_cast(model)->rowCount()); } void TestPython2::testDictVariable() { Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); QVERIFY(model != nullptr); Cantor::Expression* e=evalExp(QLatin1String("d = {'value': 33}")); QVERIFY(e!=nullptr); if(session()->status()==Cantor::Session::Running) waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); QCOMPARE(1, static_cast(model)->rowCount()); QCOMPARE(model->index(0,0).data().toString(), QLatin1String("d")); QCOMPARE(model->index(0,1).data().toString(), QLatin1String("{'value': 33}")); evalExp(QLatin1String("del d")); } QTEST_MAIN(TestPython2) diff --git a/src/backends/python2/testpython2.h b/src/backends/python2/testpython2.h index 25195ca0..2f1474da 100644 --- a/src/backends/python2/testpython2.h +++ b/src/backends/python2/testpython2.h @@ -1,47 +1,44 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2013 Tuukka Verho */ #ifndef _TESTPYTHON2_H #define _TESTPYTHON2_H #include "backendtest.h" class TestPython2 : public BackendTest { Q_OBJECT private Q_SLOTS: void testImportNumpy(); void testCodeWithComments(); void testSimpleCode(); void testMultilineCode(); void testVariablesCreatingFromCode(); - void testVariablesCreatingFromManager(); - void testVariableRemoving(); void testVariableCleanupAfterRestart(); void testDictVariable(); - private: QString backendName() override; }; #endif /* _TESTPYTHON2_H */ diff --git a/src/backends/python3/testpython3.cpp b/src/backends/python3/testpython3.cpp index f5052bcd..37edf84c 100644 --- a/src/backends/python3/testpython3.cpp +++ b/src/backends/python3/testpython3.cpp @@ -1,222 +1,181 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2015 Minh Ngo */ #include "testpython3.h" #include "session.h" #include "backend.h" #include "expression.h" #include "imageresult.h" #include "defaultvariablemodel.h" QString TestPython3::backendName() { return QLatin1String("python3"); } void TestPython3::testImportNumpy() { Cantor::Expression* e = evalExp(QLatin1String("import numpy")); QVERIFY(e != nullptr); QCOMPARE(e->status(), Cantor::Expression::Done); } void TestPython3::testCodeWithComments() { { Cantor::Expression* e = evalExp(QLatin1String("#comment\n1+2")); QVERIFY(e != nullptr); QVERIFY(e->result()->data().toString() == QLatin1String("3")); } { Cantor::Expression* e = evalExp(QLatin1String(" #comment\n1+2")); QVERIFY(e != nullptr); QVERIFY(e->result()->data().toString() == QLatin1String("3")); } } void TestPython3::testPython3Code() { { Cantor::Expression* e = evalExp(QLatin1String("print 1 + 2")); QVERIFY(e != nullptr); QVERIFY(!e->errorMessage().isEmpty()); } { Cantor::Expression* e = evalExp(QLatin1String("print(1 + 2)")); QVERIFY(e != nullptr); QVERIFY(e->result()->data().toString() == QLatin1String("3")); } } void TestPython3::testSimplePlot() { Cantor::Expression* e = evalExp(QLatin1String( "import matplotlib\n" "import matplotlib.pyplot as plt\n" "import numpy as np" )); QVERIFY(e != nullptr); QVERIFY(e->errorMessage().isEmpty() == true); //the variable model shouldn't have any entries after the module imports QAbstractItemModel* model = session()->variableModel(); QVERIFY(model != nullptr); QVERIFY(model->rowCount() == 0); //create data for plotting e = evalExp(QLatin1String( "t = np.arange(0.0, 2.0, 0.01)\n" "s = 1 + np.sin(2 * np.pi * t)" )); QVERIFY(e != nullptr); QVERIFY(e->errorMessage().isEmpty() == true); //the variable model should have two entries now QVERIFY(model->rowCount() == 2); //plot the data and check the results e = evalExp(QLatin1String( "plt.plot(t,s)\n" "plt.show()" )); waitForSignal(e, SIGNAL(gotResult())); QVERIFY(e != nullptr); QVERIFY(e->errorMessage().isEmpty() == true); QVERIFY(model->rowCount() == 2); //still only two variables //there must be one single image result QVERIFY(e->results().size() == 1); const Cantor::ImageResult* result = dynamic_cast(e->result()); QVERIFY(result != nullptr); evalExp(QLatin1String("del t; del s")); } void TestPython3::testVariablesCreatingFromCode() { QAbstractItemModel* model = session()->variableModel(); QVERIFY(model != nullptr); Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); QVERIFY(e!=nullptr); if(session()->status()==Cantor::Session::Running) waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); QCOMPARE(2, model->rowCount()); QCOMPARE(model->index(0,0).data().toString(), QLatin1String("a")); QCOMPARE(model->index(0,1).data().toString(), QLatin1String("15")); QCOMPARE(model->index(1,0).data().toString(), QLatin1String("b")); QCOMPARE(model->index(1,1).data().toString(), QLatin1String("'S'")); evalExp(QLatin1String("del a; del b")); } -void TestPython3::testVariablesCreatingFromManager() -{ - Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); - QVERIFY(model != nullptr); - - model->addVariable(QLatin1String("a"), QLatin1String("15")); - model->addVariable(QLatin1String("b"), QLatin1String("'Q'")); - - QCOMPARE(2, static_cast(model)->rowCount()); - - QCOMPARE(model->index(0,0).data().toString(), QLatin1String("a")); - QCOMPARE(model->index(0,1).data().toString(), QLatin1String("15")); - - QCOMPARE(model->index(1,0).data().toString(), QLatin1String("b")); - QCOMPARE(model->index(1,1).data().toString(), QLatin1String("'Q'")); - - evalExp(QLatin1String("del a; del b")); -} - -void TestPython3::testVariableRemoving() -{ - Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); - QVERIFY(model != nullptr); - - Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); - QVERIFY(e!=nullptr); - - if(session()->status()==Cantor::Session::Running) - waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); - - QCOMPARE(2, static_cast(model)->rowCount()); - - model->removeVariable(QLatin1String("a")); - - QCOMPARE(1, static_cast(model)->rowCount()); - QCOMPARE(model->index(0,0).data().toString(), QLatin1String("b")); - QCOMPARE(model->index(0,1).data().toString(), QLatin1String("'S'")); - - evalExp(QLatin1String("del b")); -} - void TestPython3::testVariableCleanupAfterRestart() { Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); QVERIFY(model != nullptr); Cantor::Expression* e=evalExp(QLatin1String("a = 15; b = 'S';")); QVERIFY(e!=nullptr); if(session()->status()==Cantor::Session::Running) waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); QCOMPARE(2, static_cast(model)->rowCount()); session()->logout(); session()->login(); QCOMPARE(0, static_cast(model)->rowCount()); } void TestPython3::testDictVariable() { Cantor::DefaultVariableModel* model = static_cast(session()->variableModel()); QVERIFY(model != nullptr); Cantor::Expression* e=evalExp(QLatin1String("d = {'value': 33}")); QVERIFY(e!=nullptr); if(session()->status()==Cantor::Session::Running) waitForSignal(session(), SIGNAL(statusChanged(Cantor::Session::Status))); QCOMPARE(1, static_cast(model)->rowCount()); QCOMPARE(model->index(0,0).data().toString(), QLatin1String("d")); QCOMPARE(model->index(0,1).data().toString(), QLatin1String("{'value': 33}")); evalExp(QLatin1String("del d")); } QTEST_MAIN(TestPython3) diff --git a/src/backends/python3/testpython3.h b/src/backends/python3/testpython3.h index 72632764..1645f8b5 100644 --- a/src/backends/python3/testpython3.h +++ b/src/backends/python3/testpython3.h @@ -1,45 +1,43 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2015 Minh Ngo */ #ifndef _TESTPYTHON3_H #define _TESTPYTHON3_H #include class TestPython3 : public BackendTest { Q_OBJECT private Q_SLOTS: void testImportNumpy(); void testCodeWithComments(); void testPython3Code(); void testSimplePlot(); void testVariablesCreatingFromCode(); - void testVariablesCreatingFromManager(); - void testVariableRemoving(); void testVariableCleanupAfterRestart(); void testDictVariable(); private: QString backendName() override; }; #endif /* _TESTPYTHON3_H */