]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Remove all XHP lint tests from Arcanist
authorepriestley <git@epriestley.com>
Thu, 5 Jan 2012 18:25:43 +0000 (10:25 -0800)
committerepriestley <git@epriestley.com>
Thu, 5 Jan 2012 20:58:59 +0000 (12:58 -0800)
Summary:
  - Remove XHP tests so I can remove XHP support from XHPAST.
  - Update license tests so they don't break every year.

Test Plan:   - Ran all unit tests.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran, pad, jungejason, btrahan
Maniphest Tasks: T635

Differential Revision: https://secure.phabricator.com/D1318

15 files changed:
src/lint/linter/apachelicense/__tests__/ArcanistApacheLicenseLinterTestCase.php
src/lint/linter/apachelicense/__tests__/data/c-basic.lint-test
src/lint/linter/apachelicense/__tests__/data/greedy.lint-test
src/lint/linter/apachelicense/__tests__/data/php-basic.lint-test
src/lint/linter/apachelicense/__tests__/data/php-script.lint-test
src/lint/linter/apachelicense/__tests__/data/php-update-mess.lint-test
src/lint/linter/apachelicense/__tests__/data/php-update-multi.lint-test
src/lint/linter/apachelicense/__tests__/data/php-update-single.lint-test
src/lint/linter/base/test/ArcanistLinterTestCase.php
src/lint/linter/xhpast/__tests__/data/dynamic-define.lint-test
src/lint/linter/xhpast/__tests__/data/foil-marcels-lexer.lint-test [deleted file]
src/lint/linter/xhpast/__tests__/data/naming-conventions.lint-test
src/lint/linter/xhpast/__tests__/data/parens-hug-contents.lint-test
src/lint/linter/xhpast/__tests__/data/space-after-control-keywords.lint-test
src/lint/linter/xhpast/__tests__/data/space-around-operators.lint-test

index 9015e2e28c86964b646cd6257b979f26423f1395..def0666dbbfff77edb9f172233ac03f2ea481d7b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,4 +32,9 @@ class ArcanistApacheLicenseLinterTestCase extends ArcanistLinterTestCase {
       $working_copy);
   }
 
+  protected function compareTransform($expected, $actual) {
+    $expected = str_replace('YYYY', date('Y'), $expected);
+    return parent::compareTransform($expected, $actual);
+  }
+
 }
index 125eae43d9d54594e8dcaad8af92ac92039bf5d3..1c49d4ae2a50bea3dd6c0f8b8e26b6729b723a61 100644 (file)
@@ -7,7 +7,7 @@ int main(int argv, char **argv) {
 error:1:1
 ~~~~~~~~~~
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 0f7879f098f8be8ddee7a5a812d18c75dc9b83e4..e111c0bdf28d4d62ecc4a23e9d744d62323e92c9 100644 (file)
@@ -13,7 +13,7 @@ error:1:1
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 8ec967509a57b5dcabb1474b629867b5aae3a13a..1b43f13c26e6c947ce3899406f97bd79b96e997a 100644 (file)
@@ -7,7 +7,7 @@ error:1:1
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 5332a2af900bccb19eb2cd4eedc229983d435985..36254ec4d15fa714a488bb1d6e7020d6aebb92df 100644 (file)
@@ -9,7 +9,7 @@ error:1:1
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 5d37074609d461bf608e0856458d5c5d7f2925ab..a4d306bf119a9eec0f13cfd8bb115f80f1499a3c 100644 (file)
@@ -11,7 +11,7 @@ error:1:1
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 8c662c0c4a3c0c0b2e89330bb5b5dbd832fbeb7f..4fb90031e80c77c79b6a03e8e1a40e1a1c907029 100644 (file)
@@ -9,7 +9,7 @@ error:1:1
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 8c662c0c4a3c0c0b2e89330bb5b5dbd832fbeb7f..4fb90031e80c77c79b6a03e8e1a40e1a1c907029 100644 (file)
@@ -9,7 +9,7 @@ error:1:1
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 0a4bff4a7d49b291f9d4e7efdb0b988f117f25e1..35ad1f1ff2297ad7889e1a4d57310e8083670199 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -162,7 +162,7 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
     }
   }
 
-  private function compareTransform($expected, $actual) {
+  protected function compareTransform($expected, $actual) {
     if (!strlen($expected)) {
       return;
     }
index fe6d8d660cde8e11dd692fc78193ecf0108f4f17..897c3ece1738546a066fcde916598b7c378f52a7 100644 (file)
@@ -3,7 +3,6 @@ define('pony', 'cute');
 define($pony, 'cute');
 define('pony', $cute);
 define($pony, $cute);
-<div>define($pony, $cute)</div>;
 ~~~~~~~~~~
 error:3:8 dynamic define
 error:5:8 dynamic define
diff --git a/src/lint/linter/xhpast/__tests__/data/foil-marcels-lexer.lint-test b/src/lint/linter/xhpast/__tests__/data/foil-marcels-lexer.lint-test
deleted file mode 100644 (file)
index 3072460..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-// This test is just making sure we have undone all of the stream elision that
-// the default XHP grammar does, since it does certain transformations against
-// whitespace and entities in the lexer itself. If our parse tree elides
-// whitespace, the "+" operator trigger on the last line will patch at the wrong
-// offset and the test will fail.
-<div
-      id 
-      
-        =
-        
-          {
-            
-                $x
-                
-                
-                    }
-                       >
-  x
-  
-    {
-        $x
-        
-        }
-        
-        <a />
-        
-          &amp;
-          
-          '
-          
-          "
-  
-   </div>
-              
-              
-                 ;
-
-$x+$y;
-~~~~~~~~~~
-warning:39:3
-~~~~~~~~~~
-<?php
-// This test is just making sure we have undone all of the stream elision that
-// the default XHP grammar does, since it does certain transformations against
-// whitespace and entities in the lexer itself. If our parse tree elides
-// whitespace, the "+" operator trigger on the last line will patch at the wrong
-// offset and the test will fail.
-<div
-      id 
-      
-        =
-        
-          {
-            
-                $x
-                
-                
-                    }
-                       >
-  x
-  
-    {
-        $x
-        
-        }
-        
-        <a />
-        
-          &amp;
-          
-          '
-          
-          "
-  
-   </div>
-              
-              
-                 ;
-
-$x + $y;
index 69fc54ef2c3ae5cf4fea15e30acc4de1c89bfa0a..e03d9fadbc74d0166710633555b0b3b8ca2784e2 100644 (file)
@@ -7,7 +7,7 @@ class a {
 
 interface i { }
 
-class :XhpStuff { }
+
 
 function YY($ZZ) { }
 
@@ -17,9 +17,9 @@ class Quack {
   public function vV($w_w) { }
 }
 
-<div class="protected function">const $y;</div>;
 
-class :ui:lol-whatever:omg { }
+
+
 
 function () use ($this_is_a_closure) { };
 
@@ -35,7 +35,6 @@ warning:5:19
 warning:5:21
 warning:5:25
 warning:8:11
-warning:10:7
 warning:12:10
 warning:12:13
 warning:26:12
\ No newline at end of file
index 5cd11a3719cdcba9250b703db7028137c2c8a583..a5c95041c203d2552364c696e53b94ef35d6f7a4 100644 (file)
@@ -5,7 +5,7 @@ q(                      );
 g();
 if ($x) { }
 else if ( $y ) { }
-<div>( a b c )</div>;
+
 $obj->m(
   $x,
   $y,
@@ -48,7 +48,7 @@ q();
 g();
 if ($x) { }
 else if ($y) { }
-<div>( a b c )</div>;
+
 $obj->m(
   $x,
   $y,
index 0febb585e7bfd897e434d2f53a8db26f6d9c0a62..c66723b67978bf330f3fc6a175537ef81ea0a565 100644 (file)
@@ -9,7 +9,7 @@ switch($x) {}
 if ($x) {}
 else if ($y) {}
 else if ($z) {}
-<strong>if</strong>;
+
 if  ($x) {}
 if
 
@@ -37,6 +37,6 @@ switch ($x) {}
 if ($x) {}
 else if ($y) {}
 else if ($z) {}
-<strong>if</strong>;
+
 if ($x) {}
 if ($x) {}
index 31aa35f099b1d5d0b4f18a9e122eefbb00bfcb6c..fb4c40371c7b4dad7043520c3e305467a02f7f3e 100644 (file)
@@ -12,15 +12,15 @@ $a===$b;
 $a.$b;
 function x($n=null) { }
 function x($n = null) { }
-<div id="id">1+1=2</div>;
+
 $y /* ! */ += // ?
 $z;
 $obj->method();
 Dog::bark();
 $prev = ($total == 1) ? $navids[0] : $navids[$total-1];
 $next = ($total == 1) ? $navids[0] : $navids[$current+1];
-if ($x instanceof :y:z &&$w) { }
-if ($x instanceof :y:z && $w) { }
+if ($x instanceof z &&$w) { }
+if ($x instanceof z && $w) { }
 ~~~~~~~~~~
 warning:3:3
 warning:4:4
@@ -32,7 +32,7 @@ warning:10:3
 warning:11:3
 warning:20:52
 warning:21:54
-warning:22:24
+warning:22:21
 ~~~~~~~~~~
 <?php
 $a + $b;
@@ -48,12 +48,12 @@ $a === $b;
 $a.$b;
 function x($n=null) { }
 function x($n = null) { }
-<div id="id">1+1=2</div>;
+
 $y /* ! */ += // ?
 $z;
 $obj->method();
 Dog::bark();
 $prev = ($total == 1) ? $navids[0] : $navids[$total - 1];
 $next = ($total == 1) ? $navids[0] : $navids[$current + 1];
-if ($x instanceof :y:z && $w) { }
-if ($x instanceof :y:z && $w) { }
+if ($x instanceof z && $w) { }
+if ($x instanceof z && $w) { }