forked from semgrep/semgrep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
annotation tests for GA languages (semgrep#2143)
- Loading branch information
Showing
7 changed files
with
90 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,4 @@ | ||
@$X | ||
class $CLASS { | ||
... | ||
} |
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,21 @@ | ||
// ERROR: | ||
@AnnoFoo | ||
class Foo { | ||
int foo = 1; | ||
} | ||
|
||
// ERROR: | ||
@Anno1 | ||
@Anno2 | ||
class FooBar { | ||
int foobar = 2; | ||
} | ||
|
||
@AnnoBar(bar = "bar") | ||
class Bar { | ||
int bar = 1; | ||
} | ||
|
||
class NoAnno { | ||
int noanno = 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,18 @@ | ||
class Foo { | ||
// ERROR: | ||
@Override | ||
public void foo1() { | ||
int x = 1; | ||
} | ||
|
||
// ERROR: | ||
@Anno1 | ||
@Anno2 | ||
public void foo2() { | ||
int x = 2; | ||
} | ||
|
||
public void foo3() { | ||
int x = 3; | ||
} | ||
} |
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 @@ | ||
@$X | ||
public void $FUNC (...) { | ||
... | ||
} |
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,21 @@ | ||
// ERROR: | ||
@Anno1 | ||
class Foo { | ||
var foo = 1; | ||
} | ||
|
||
// ERROR: | ||
@Anno1 | ||
@Anno2 | ||
class FooBar { | ||
var foo = 2; | ||
} | ||
|
||
@AnnoVar("Bar") | ||
class Bar { | ||
var bar = 1; | ||
} | ||
|
||
class NoAnno { | ||
var no_anno = 1; | ||
} |
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,19 @@ | ||
# ERROR: | ||
@anno1 | ||
def bar(foo: 'foo'): | ||
x = 2 | ||
|
||
# ERROR: | ||
@anno1 | ||
@anno2 | ||
def foobar(): | ||
x = 3 | ||
|
||
@app.route('/foo') | ||
def foo(): | ||
x = 1 | ||
|
||
def no_anno(): | ||
x = 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,3 @@ | ||
@$X | ||
def $FUNC(...): | ||
... |