mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Add tests for CompilationUnit's subtypes
This commit is contained in:
@@ -81,5 +81,15 @@ public class GroovyCompilationUnitTest extends HttpServlet {
|
||||
cu.addSource(su);
|
||||
cu.compile(); // Safe
|
||||
}
|
||||
{
|
||||
JavaAwareCompilationUnit cu = new JavaAwareCompilationUnit();
|
||||
cu.addSource("test", request.getParameter("source"));
|
||||
cu.compile(); // $hasGroovyInjection
|
||||
}
|
||||
{
|
||||
JavaStubCompilationUnit cu = new JavaStubCompilationUnit(null, null);
|
||||
cu.addSource("test", request.getParameter("source"));
|
||||
cu.compile(); // Safe - JavaStubCompilationUnit only creates stubs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user