[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdev-ruby] duchain/tests: Test for crash during heredoc parsing. Currently we have two problems:
From: Alexander Dymo <adymo () kdevelop ! org>
Date: 2012-10-24 22:09:45
Message-ID: 20121024220945.26DE9A6078 () git ! kde ! org
[Download RAW message or body]
Git commit 968fa062af989f3a41eff3b391b6bbb17dcd822f by Alexander Dymo.
Committed on 25/10/2012 at 00:06.
Pushed by dymo into branch 'master'.
Test for crash during heredoc parsing. Currently we have two problems:
- we treat heredoc as ruby code
- we fail during heredoc parsing and crash instead of bailing out
M +13 -0 duchain/tests/duchain.cpp
M +1 -0 duchain/tests/duchain.h
http://commits.kde.org/kdev-ruby/968fa062af989f3a41eff3b391b6bbb17dcd822f
diff --git a/duchain/tests/duchain.cpp b/duchain/tests/duchain.cpp
index aa582a3..46c4e77 100644
--- a/duchain/tests/duchain.cpp
+++ b/duchain/tests/duchain.cpp
@@ -396,6 +396,19 @@ void TestDUChain::forStatement()
testUnsureTypes(ut, list);
}
+void TestDUChain::hereDoc()
+{
+ // heredoc should be a string and should not be parsed as ruby code
+ QByteArray code("execute <<EOS\n\
+foo (\n\
+EOS\n\
+");
+ TopDUContext *top = parse(code, "hereDoc");
+
+ DOES_NOT_CRASH;
+}
+
+
//END: Statements
//BEGIN: Assignments
diff --git a/duchain/tests/duchain.h b/duchain/tests/duchain.h
index be4861c..71d94ff 100644
--- a/duchain/tests/duchain.h
+++ b/duchain/tests/duchain.h
@@ -85,6 +85,7 @@ private slots:
void ifStatement();
void caseStatement();
void forStatement();
+ void hereDoc();
// Assignments
void simpleUnsure();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic