diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/dummy/DummyWarningWarnTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/dummy/DummyWarningWarnTest.kt new file mode 100644 index 0000000000..6775038a64 --- /dev/null +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/dummy/DummyWarningWarnTest.kt @@ -0,0 +1,31 @@ +package org.cqfn.diktat.ruleset.dummy + +import org.cqfn.diktat.ruleset.constants.Warnings.DUMMY_TEST_WARNING +import org.cqfn.diktat.ruleset.rules.DIKTAT_RULE_SET_ID +import org.cqfn.diktat.util.LintTestBase + +import com.pinterest.ktlint.core.LintError +import generated.WarningNames +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Tag +import org.junit.jupiter.api.Test + +/** + * In this class you can test the logic of your rule, which should be implemented in DummyWarning + */ +class DummyWarningWarnTest : LintTestBase(::DummyWarning) { + private val ruleId = "$DIKTAT_RULE_SET_ID:dummy-rule" + + // Remove @Disabled annotation before usage + @Disabled + @Test + @Tag(WarningNames.DUMMY_TEST_WARNING) + fun `check dummy property`() { + lintMethod( + """ + |// provide your check here + """.trimMargin(), + LintError(1, 1, ruleId, "${DUMMY_TEST_WARNING.warnText()} some detailed explanation", true) + ) + } +} diff --git a/info/guide/guide-chapter-1.md b/info/guide/guide-chapter-1.md index ae8237d95d..df5ac11528 100644 --- a/info/guide/guide-chapter-1.md +++ b/info/guide/guide-chapter-1.md @@ -40,6 +40,7 @@ The only exception is function names in `Unit tests.` @Test fun `my test`() { /*...*/ } ``` 6. The following table contains some characters that may cause confusion. Be careful when using them as identifiers. To avoid issues, use other names instead. + | Expected | Confusing name | Suggested name | | ------------- | ------------------------ | ---------------- | | 0 (zero) | O, D | obj, dgt |