-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move code.search tests under codemarkup/hack
Summary: Looking at Hack now. Start by consolidating the search tests Reviewed By: simonmar Differential Revision: D66689693 fbshipit-source-id: 11cdda4d648fd7e700e7fa0416eab5f57dc405d6
- Loading branch information
1 parent
076d45a
commit 29713b7
Showing
98 changed files
with
1,875 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# some comment | ||
assume_php = false | ||
|
||
allowed_fixme_codes_strict = 4110 | ||
allowed_decl_fixme_codes = 4110 | ||
|
||
auto_namespace_map = {"Herp": "Derp\\Lib\\Herp"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?hh | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
new module glean.test { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?hh | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
class RefClass implements SourceInterface { | ||
use SourceTrait; | ||
|
||
const int JAZZ = 39; | ||
|
||
private int $raz = -50; | ||
|
||
public static function foo(): int { | ||
return corge() * WALDO; | ||
} | ||
|
||
public function bazza (): int { | ||
return 5 * corge(); | ||
} | ||
|
||
public function bar(SourceClass::T $param): int { | ||
$source = new SourceClass(); | ||
$result1 = corge() + SourceClass::BAZ + $source->daz + $this::JAZZ + WALDO; | ||
$result2 = $this->quux($result1) + Position::Right + $this::foo(); | ||
$result3 = $this->raz + $this->bazza() + SourceClass::superAdd(1, $param); | ||
return ($result1 + $result2 + $result3 + Position::Center) * corge(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?hh | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
class SourceClass extends SuperClass { | ||
|
||
const int BAZ = 2; | ||
|
||
const type T = int; | ||
|
||
public int $daz = 99; | ||
|
||
public function bar(int $param): int { | ||
return $param * corge(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
glean/lang/codemarkup/tests/hack/search/SourceInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?hh | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
interface SourceInterface { | ||
|
||
abstract const int JAZZ; | ||
|
||
public static function foo(): int; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?hh | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
trait SourceTrait { | ||
public function quux(int $i): int { | ||
return $i * 2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?hh | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
class SuperClass { | ||
|
||
const int BAZ = 999; | ||
|
||
public function superAdd(int $i, int $i): int { | ||
return $i + $i + 55; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?hh | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
const int WALDO = -3; | ||
|
||
function corge() : int { | ||
return 5000 + WALDO; | ||
} | ||
|
||
enum Position: int as int { | ||
Top = 0; | ||
Bottom = 1; | ||
Left = 2; | ||
Right = 3; | ||
Center = 4; | ||
} |
Oops, something went wrong.