diff --git a/sources/awesomewidgets/extscript.cpp b/sources/awesomewidgets/extscript.cpp index 9c06c85..c7823f2 100644 --- a/sources/awesomewidgets/extscript.cpp +++ b/sources/awesomewidgets/extscript.cpp @@ -72,6 +72,7 @@ ExtScript *ExtScript::copy(const QString _fileName, const int _number) item->setNumber(_number); item->setPrefix(prefix()); item->setRedirect(redirect()); + item->setFilters(filters()); return item; } diff --git a/sources/test/testextscript.cpp b/sources/test/testextscript.cpp index d397550..ded0da1 100644 --- a/sources/test/testextscript.cpp +++ b/sources/test/testextscript.cpp @@ -21,7 +21,6 @@ #include #include "extscript.h" -#include "version.h" void TestExtScript::initTestCase() @@ -44,6 +43,9 @@ void TestExtScript::cleanupTestCase() } + + + void TestExtScript::test_values() { QCOMPARE(extScript->interval(), 1); @@ -87,4 +89,19 @@ void TestExtScript::test_filters() } +void TestExtScript::test_copy() +{ + ExtScript *newExtScript = extScript->copy(QString("/dev/null"), 1); + + QCOMPARE(newExtScript->interval(), extScript->interval()); + QCOMPARE(newExtScript->executable(), extScript->executable()); + QCOMPARE(newExtScript->strRedirect(), extScript->strRedirect()); + QCOMPARE(newExtScript->prefix(), extScript->prefix()); + QCOMPARE(newExtScript->filters(), extScript->filters()); + QCOMPARE(newExtScript->number(), 1); + + delete newExtScript; +} + + QTEST_MAIN(TestExtScript); diff --git a/sources/test/testextscript.h b/sources/test/testextscript.h index b9cc3b5..2f5688d 100644 --- a/sources/test/testextscript.h +++ b/sources/test/testextscript.h @@ -38,6 +38,7 @@ private slots: void test_values(); void test_run(); void test_filters(); + void test_copy(); private: ExtScript *extScript = nullptr;