Search in sources :

Example 1 with MagikCheck

use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.

the class MethodComplexityCheckTest method testNotTooComplex.

@Test
void testNotTooComplex() {
    final MagikCheck check = new MethodComplexityCheck();
    final String code = "" + "_method a.b\n" + "    _if a" + "    _then" + "    _endif\n" + "_endmethod\n";
    final List<MagikIssue> issues = this.runCheck(code, check);
    assertThat(issues).isEmpty();
}
Also used : MagikCheck(nl.ramsolutions.sw.magik.checks.MagikCheck) MagikIssue(nl.ramsolutions.sw.magik.checks.MagikIssue) Test(org.junit.jupiter.api.Test)

Example 2 with MagikCheck

use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.

the class MethodDocCheckTest method testMethodDocMissingParametersSingle.

@Test
void testMethodDocMissingParametersSingle() {
    final MagikCheck check = new MethodDocCheck();
    final String code = "" + "_method a.b(param1, param2)\n" + "    ## Function: example\n" + "    ## Parameters: PARAM1: example parameters\n" + "    ## Returns: -\n" + "_endmethod";
    final List<MagikIssue> issues = this.runCheck(code, check);
    assertThat(issues).hasSize(1);
}
Also used : MagikCheck(nl.ramsolutions.sw.magik.checks.MagikCheck) MagikIssue(nl.ramsolutions.sw.magik.checks.MagikIssue) Test(org.junit.jupiter.api.Test)

Example 3 with MagikCheck

use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.

the class MethodDocCheckTest method testMethodDocParametersIndexMissing.

@Test
void testMethodDocParametersIndexMissing() {
    final MagikCheck check = new MethodDocCheck();
    final String code = "" + "_method a[index]\n" + "    ## Function: example\n" + "    ## Parameters: -\n" + "    ## Returns: -\n" + "_endmethod";
    final List<MagikIssue> issues = this.runCheck(code, check);
    assertThat(issues).hasSize(1);
}
Also used : MagikCheck(nl.ramsolutions.sw.magik.checks.MagikCheck) MagikIssue(nl.ramsolutions.sw.magik.checks.MagikIssue) Test(org.junit.jupiter.api.Test)

Example 4 with MagikCheck

use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.

the class MethodDocCheckTest method testMethodDocMissingFunction.

@Test
void testMethodDocMissingFunction() {
    final MagikCheck check = new MethodDocCheck();
    final String code = "" + "_method a.b(param1)\n" + "    ## Parameters: PARAM1: example parameters\n" + "    ## Returns: -\n" + "_endmethod";
    final List<MagikIssue> issues = this.runCheck(code, check);
    assertThat(issues).hasSize(1);
}
Also used : MagikCheck(nl.ramsolutions.sw.magik.checks.MagikCheck) MagikIssue(nl.ramsolutions.sw.magik.checks.MagikIssue) Test(org.junit.jupiter.api.Test)

Example 5 with MagikCheck

use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.

the class MethodDocCheckTest method testMethodDocParametersOptional.

@Test
void testMethodDocParametersOptional() {
    final MagikCheck check = new MethodDocCheck();
    final String code = "" + "_method a.b(_optional param1)\n" + "    ## Function: example\n" + "    ## Parameters: PARAM1: parameter 1\n" + "    ## Returns: -\n" + "_endmethod";
    final List<MagikIssue> issues = this.runCheck(code, check);
    assertThat(issues).isEmpty();
}
Also used : MagikCheck(nl.ramsolutions.sw.magik.checks.MagikCheck) MagikIssue(nl.ramsolutions.sw.magik.checks.MagikIssue) Test(org.junit.jupiter.api.Test)

Aggregations

MagikCheck (nl.ramsolutions.sw.magik.checks.MagikCheck)190 MagikIssue (nl.ramsolutions.sw.magik.checks.MagikIssue)190 Test (org.junit.jupiter.api.Test)188 Path (java.nio.file.Path)4 IOException (java.io.IOException)2 URI (java.net.URI)2 MagikFile (nl.ramsolutions.sw.magik.MagikFile)2 Writer (java.io.Writer)1 Charset (java.nio.charset.Charset)1 FileSystem (java.nio.file.FileSystem)1 FileSystems (java.nio.file.FileSystems)1 Files (java.nio.file.Files)1 PathMatcher (java.nio.file.PathMatcher)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Comparator (java.util.Comparator)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1