use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ArgsDef method testVarAndArgs_Cfscript.
@Test
public void testVarAndArgs_Cfscript() throws CFLintScanException {
final String cfcSrc = "component { \r\n" + "public void function foo(any arg1) { \r\n" + "} \r\n" + "}";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
final List<BugInfo> result = lintresult.getIssues().values().iterator().next();
assertEquals(1, result.size());
assertEquals("ARG_DEFAULT_MISSING", result.get(0).getMessageCode());
assertEquals(2, result.get(0).getLine());
}
use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ArgsDef method testVarAndArgs_Cfscript_OK2.
@Test
public void testVarAndArgs_Cfscript_OK2() throws CFLintScanException {
final String cfcSrc = "component { \r\n" + "public void function foo(any arg1=\"123\") { \r\n" + "} \r\n" + "}";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
final Map<String, List<BugInfo>> result = lintresult.getIssues();
assertEquals(0, result.size());
}
use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ArgsDef method testVarAndArgs_Cfscript_OK.
@Test
public void testVarAndArgs_Cfscript_OK() throws CFLintScanException {
final String cfcSrc = "component { \r\n" + "public void function foo(required any arg1) { \r\n" + "} \r\n" + "}";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
final Map<String, List<BugInfo>> result = lintresult.getIssues();
assertEquals(0, result.size());
}
use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ArgsDef method testVarAndArgs_OK1.
@Test
public void testVarAndArgs_OK1() throws CFLintScanException {
final String cfcSrc = "<cfcomponent>\r\n" + "<cffunction name=\"test\">\r\n" + " <cfargument name=\"xyz\" default=\"123\">\r\n" + "</cffunction>\r\n" + "</cfcomponent>";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
final Map<String, List<BugInfo>> result = lintresult.getIssues();
assertEquals(0, result.size());
}
use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ArgsDefCond method testVarAndArgs_Cfscript_OK3.
@Test
@Ignore("Checking downstream structkeyexists is not implemented")
public void testVarAndArgs_Cfscript_OK3() throws CFLintScanException {
final String cfcSrc = "component { \r\n" + "public void function foo(any arg1) { \r\n if(structkeyexists(arguments, \"arg1\")){}" + "} \r\n" + "}";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
final Map<String, List<BugInfo>> result = lintresult.getIssues();
assertEquals(0, result.size());
}
Aggregations