diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp
index e3ae2b936a03a40e58655a8359940370c8d0ab37..a9344b6da97ceb20cd9710ff04f4b4f1de439fdd 100644
--- a/src/tests/tests.cpp
+++ b/src/tests/tests.cpp
@@ -1553,6 +1553,16 @@ void Tests::commandLoadTheme()
         tmp.close();
         RUN("loadTheme" << tmp.fileName(), "");
     }
+
+    // Verify default stylesheets - if there is a syntax error,
+    // application prints a warning which should be captured by tests.
+    {
+        QTemporaryFile tmp;
+        QVERIFY(tmp.open());
+        tmp.write("[General]\nstyle_main_window=true");
+        tmp.close();
+        RUN("loadTheme" << tmp.fileName(), "");
+    }
 }
 
 void Tests::commandDateString()