[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/devtools/kdevelop4-extra-plugins/php/duchain/tests
From:       Milian Wolff <mail () milianw ! de>
Date:       2009-05-11 16:46:57
Message-ID: 1242060417.809321.18319.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 966618 by mwolff:

add test for variable redeclaration which currently fails

script languages should see redeclarations as uses of the first declaration.

 M  +18 -0     test_uses.cpp  
 M  +1 -0      test_uses.h  


--- trunk/playground/devtools/kdevelop4-extra-plugins/php/duchain/tests/test_uses.cpp #966617:966618
@@ -564,7 +564,25 @@
     compareUses(d, SimpleRange(0, 18, 0, 27));
 }
 
+void TestUses::variableRedeclaration()
+{
+    //                 0         1         2         3         4         5         6         7
+    //                 01234567890123456789012345678901234567890123456789012345678901234567890123456789
+    QByteArray method("<? $s = 'a'; $s = $s . $s;");
+
+    TopDUContext* top = parse(method, DumpAll);
+    DUChainReleaser releaseTop(top);
+    DUChainWriteLocker lock(DUChain::lock());
+
+    Declaration *d = top->findDeclarationAt(QualifiedIdentifier("s")).first();
+    compareUses(d, QList<SimpleRange>()
+                     << SimpleRange(0, 13, 0, 15)
+                     << SimpleRange(0, 18, 0, 20)
+                     << SimpleRange(0, 23, 0, 25)
+                );
 }
 
+}
 
+
 #include "test_uses.moc"
--- trunk/playground/devtools/kdevelop4-extra-plugins/php/duchain/tests/test_uses.h #966617:966618
@@ -64,6 +64,7 @@
     void assignmentToMemberArray();
     void functionParamNewDeclaration();
     void catchClass();
+    void variableRedeclaration();
 };
 
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic