diff --git a/src/tests/testdata/included_level1a.tex b/src/tests/testdata/included_level1a.tex new file mode 100644 index 0000000000..b9fd160cd9 --- /dev/null +++ b/src/tests/testdata/included_level1a.tex @@ -0,0 +1,4 @@ +\label{test_level1} + +\include{included_level2a} + diff --git a/src/tests/testdata/included_level2a.tex b/src/tests/testdata/included_level2a.tex new file mode 100644 index 0000000000..afcc0f6229 --- /dev/null +++ b/src/tests/testdata/included_level2a.tex @@ -0,0 +1,4 @@ +\usepackage{siunitx} +\usepackage{wasysym} + +\label{test_level2} \ No newline at end of file diff --git a/src/tests/testdata/top_buried_package.tex b/src/tests/testdata/top_buried_package.tex new file mode 100644 index 0000000000..6d08fa9b73 --- /dev/null +++ b/src/tests/testdata/top_buried_package.tex @@ -0,0 +1,14 @@ +\include{included_level1a} + +\GHz +\clock +\degreeCelsius +\ref{test_level1} + +\ref{test_level2} +\section{dsdfgdfgse} + +\subsection{dffdfssssfdf} + + + diff --git a/src/tests/texstudio_t.cpp b/src/tests/texstudio_t.cpp index 6a402281c4..c3054af483 100644 --- a/src/tests/texstudio_t.cpp +++ b/src/tests/texstudio_t.cpp @@ -35,6 +35,8 @@ void TexStudioTest::checkIncludes_data(){ <setLanguageFromName(currentEditorView()->editor, "TXS Test Results"); + QEditor *ed=currentEditor(); + if(!ed){ + qDebug()<<"Editor was closed."; + fileNew(); + ed=currentEditor(); + } + m_languages->setLanguageFromName(ed, "TXS Test Results"); currentEditorView()->editor->setText(result, false); if (result.startsWith("*** THERE SEEM TO BE FAILED TESTS! ***")) { QSearchReplacePanel *searchpanel = qobject_cast(currentEditorView()->codeeditor->panels("Search")[0]);