From fb28b933759f4b3ebabc421446807ff4dcf34aaf Mon Sep 17 00:00:00 2001 From: Ilia Permiashkin Date: Mon, 16 Jun 2025 11:32:18 +0000 Subject: [PATCH] IJPL-191662 Fix `intellij.spellchecker` tests Merge-request: IJ-MR-165732 Merged-by: Ilia Permiashkin GitOrigin-RevId: b342341bb3c1976afaa6247cb3612c0f5f2d9c53 --- spellchecker/BUILD.bazel | 2 + spellchecker/intellij.spellchecker.iml | 1 + spellchecker/testResources/data/words.dat | 6 +- .../testResources/data/words_camel_case.dat | 58 +++++++++---------- .../dataset/DataSetPerformanceTest.kt | 20 +++---- .../dataset/DataSetQualityTest.kt | 45 +++++++------- .../intellij/spellchecker/dataset/Datasets.kt | 2 +- .../CommentsWithMistakesInspectionTest.java | 4 -- .../inspection/SpellcheckerCornerCasesTest.kt | 11 +++- .../XmlWithMistakesInspectionTest.java | 7 --- .../quickfixes/XmlSpellCheckerFixesTest.java | 4 -- 11 files changed, 78 insertions(+), 82 deletions(-) diff --git a/spellchecker/BUILD.bazel b/spellchecker/BUILD.bazel index 700ede80f81d..a2ec0b811aa4 100644 --- a/spellchecker/BUILD.bazel +++ b/spellchecker/BUILD.bazel @@ -88,6 +88,8 @@ jvm_library( "@lib//:caffeine", "//tools/intellij.tools.ide.metrics.benchmark:ide-metrics-benchmark", "//tools/intellij.tools.ide.metrics.benchmark:ide-metrics-benchmark_test_lib", + "//xml/relaxng", + "//xml/relaxng:relaxng_test_lib", ], runtime_deps = [ ":spellchecker_resources", diff --git a/spellchecker/intellij.spellchecker.iml b/spellchecker/intellij.spellchecker.iml index f2deec7ce074..265645096fc3 100644 --- a/spellchecker/intellij.spellchecker.iml +++ b/spellchecker/intellij.spellchecker.iml @@ -53,5 +53,6 @@ + \ No newline at end of file diff --git a/spellchecker/testResources/data/words.dat b/spellchecker/testResources/data/words.dat index 6c8d0d24fe83..ff1e1de5acb8 100644 --- a/spellchecker/testResources/data/words.dat +++ b/spellchecker/testResources/data/words.dat @@ -8,7 +8,7 @@ locally: localy compare: compair pronunciation: pronounciation transportability: transportibility -minuscule: miniscule +minuscule: muniscule munuscule independent: independant independant arranged: aranged arrainged poetry: poartry poertry poetre poety powetry @@ -26,7 +26,7 @@ separate: seperate necessary: neccesary necesary neccesary necassary necassery neccasary definition: defenition receipt: receit receite reciet recipt -remind: remine remined +remind: remynd initials: inetials inistals initails initals intials magnificent: magnificnet magificent magnifcent magnifecent magnifiscant magnifisent magnificant aunt: annt anut @@ -398,7 +398,7 @@ especially: especaily proportions: proprtions geographically: goegraphicaly encompassing: encompasing -stopped: stoped +stopped: stopd stoppped relevant: relavent relevaant they: thay applied: upplied diff --git a/spellchecker/testResources/data/words_camel_case.dat b/spellchecker/testResources/data/words_camel_case.dat index 191928e4bcfd..8349cee80bb8 100644 --- a/spellchecker/testResources/data/words_camel_case.dat +++ b/spellchecker/testResources/data/words_camel_case.dat @@ -57,7 +57,7 @@ outputInconvenient: outputInconvienient outputInconvient outputInconvinient sessionMeans: sessionMeens availableGenevaCertain: availableGenevaCirtain profitsReceiveNecessary: profitsReceiveNeccesary profitsReceiveNecesary profitsReceiveNecassary profitsReceiveNecassery profitsReceiveNeccasary -hierarchicalFamiliesRemind: hierarchicalFamiliesRemine hierarchicalFamiliesRemined +hierarchicalFamiliesRemind: hierarchicalFamiliesRemynd hierarchicalFamiliesReminde falseReceiptConsist: falseReceiptConsisit discretionAcquaintances: discretionAquantences associatedSheets: associatedSheertes @@ -130,7 +130,7 @@ drivenQueriesExponentially: drivenQueriesExponentualy parallelQuestionnaire: parallelQuestionaire functionallyAwfulContinued: functionallyAwfulContuned widelyUnnecessary: widelyUnessessay -whereasJournalismStopped: whereasJournalismStoped +whereasJournalismStopped: whereasJournalismStopd traditionallyContinued: traditionallyContuned reallyBeginning: reallyBegining cemeteryCollate: cemeteryColate @@ -234,7 +234,7 @@ natureDesiccateDefinitely: natureDesiccateDefinately natureDesiccateDifinately extremelyThroughoutInconceivable: extremelyThroughoutInconcievable readjustedSplendidDecides: readjustedSplendidDescides graphicallyDemandsArguing: graphicallyDemandsAurguing -utilizedStopped: utilizedStoped +utilizedStopped: utilizedStoppd declarationsPatternsCompletely: declarationsPatternsCompletly februaryDecision: februaryDescisions februaryDescision briefLieuMeans: briefLieuMeens @@ -276,7 +276,7 @@ componentWroteHowever: componentWroteHoweverr minutesComposedInitials: minutesComposedInetials minutesComposedInistals minutesComposedInitails minutesComposedInitals minutesComposedIntials opinionAccessibilityLiterature: opinionAccessibilityLitriture whetherGeographically: whetherGoegraphicaly -definitionsDependenceAcademically: definitionsDependenceAcademicly +dependenceAcademically: dependenceAcademicly draggedDifficultyDescription: draggedDifficultyDesription draggedDifficultyDescvription draggedDifficultyDesacription immediateOutputProjects: immediateOutputProjeccts employmentArguing: employmentAurguing @@ -305,12 +305,12 @@ poemGraphically: poemGraphicaly valuablePrimarily: valuablePimarily arguingPronunciation: arguingPronounciation favourableArgument: favourableAurgument -embellishingParametersAdvantageous: embellishingParametersAdvantageos +parametersAdvantageous: parametersAdvantageos earliestDisciplineBusy: earliestDisciplineBuisy particularVoluntarySupervision: particularVoluntarySupervison controlledProportionsProgression: controlledProportionsProgresion resolvedSuffering: resolvedSuufering -magnificentEconometricAvailability: magnificentEconometricAvaiblity +econometricAvailability: econometricAvaiblity conditioningMonths: conditioningMonthes priorManuallyGallery: priorManuallyGalery priorManuallyGallary priorManuallyGallerry priorManuallyGallrey universityData: universityDsata @@ -371,7 +371,7 @@ availableLuckily: availableLuckeley professionBenefitParallel: professionBenefitParalel professionBenefitParalell professionBenefitParrallel professionBenefitParralell professionBenefitParrallell approximatelyDecides: approximatelyDescides clericalPermanentFalse: clericalPermanentFaulse -interpretationAppointmentDifficulty: interpretationAppointmentDificulty +appointmentDifficulty: appointmentDificulty diagrammaticallyLonelyConference: diagrammaticallyLonelyConferance minutesSurroundingAssociated: minutesSurroundingAssosiated definitionsThere: definitionsTher @@ -397,7 +397,7 @@ familiarRecentlyBonus: familiarRecentlyBonas referredUtilizedEarliest: referredUtilizedEarlyest pronunciationCommittees: pronunciationComittees pronunciationCommitees laughManagement: laughManagment -particularPossibilitiesUnresolved: particularPossibilitiesUnresloved +possibilitiesUnresolved: possibilitiesUnresloved nationallyRegisterPossibilities: nationallyRegisterPossablities qualitiesCancellation: qualitiesCancelation thoughtsLevels: thoughtsLevaals @@ -429,7 +429,7 @@ levelDoubt: levelDoupt weaponsEliminatedAppointments: weaponsEliminatedApointments sensibleSafeguard: sensibleSafegaurd doubtNecessitates: doubtNessisitates -understandableSeniorResponsibilities: understandableSeniorResponsiblities +seniorResponsibilities: seniorResponsiblities thereInconceivable: thereInconcievable seniorSeenValuable: seniorSeenValubale seniorSeenValuble thereforeRecommend: thereforeRecomend @@ -475,19 +475,19 @@ componentArrangements: componentAraingements draggedResolved: draggedResoved purpleAppointmentDescription: purpleAppointmentDiscription recommendApparentIrrelevant: recommendApparentIrrelavent -associatedUniversallyUnnecessarily: associatedUniversallyUnessasarily +universallyUnnecessarily: universallyUnessasarily accountAlthough: accountAthough -arrangementConsiderableFunctionally: arrangementConsiderableFunctionaly +considerableFunctionally: considerableFunctionaly oppositeExamine: oppositeExamin basicallyUnresolvedParticularly: basicallyUnresolvedParticulary unionThroughoutParameters: unionThroughoutPerametres arrangementIntelligence: arrangementInteligence routineAccessEstablishing: routineAccessAstablishing routineAccessEstablising -irrelevantInterpretationConfirmation: irrelevantInterpretationConfermation +interpretationConfirmation: interpretationConfermation acquaintancesVariable: acquaintancesVarible acquaintancesVaiable questionnaireSpeakingDevelop: questionnaireSpeakingDevelope believeApplicableVoluntary: believeApplicableVolantary -announcementEstablishingUmbrella: announcementEstablishingUmberalla +establishingUmbrella: establishingUmberalla occurrenceContinuedBrief: occurrenceContinuedBrif reachingAwfulBenefit: reachingAwfulBenifit variantInterest: variantIntrest @@ -496,7 +496,6 @@ adaptableFalseApproximately: adaptableFalseAproximatly embellishingGenevaThere: embellishingGenevaThear executedMisleading: executedMissleading combineSurroundings: combineSuroundings combineSeroundings -standardizingRemind: standardizingRemine standardizingRemined argumentLieu: argumentLiew oftenTherefore: oftenTherefoe investigatedDevelop: investigatedDevelope @@ -508,7 +507,7 @@ careerAnalysisErroneous: careerAnalysisErrounous particularExtremely: particularExtreemly reallySecurityUnfortunately: reallySecurityUnfortunatly stomachImmediate: stomachImediate -applicableUnequivocallyAnnouncing: applicableUnequivocallyAnouncing +unequivocallyAnnouncing: unequivocallyAnouncing successiveSuggestion: successiveSugestion definitelyHierarchy: definitelyHierchy earliestWere: earliestWeree @@ -569,10 +568,10 @@ surveyingHoweverChoosing: surveyingHoweverChosing requestedVisitors: requestedVistors adequatelyCemeteryThoughts: adequatelyCemeteryThorts favourableAccepted: favourableAcepted -correspondenceHierarchicalSpeaking: correspondenceHierarchicalSpeeking +hierarchicalSpeaking: hierarchicalSpeeking disciplineInterrogating: disciplineInterogationg availableApproached: availableAproached -aggravatingConditioningMonitoring: aggravatingConditioningMonitering +conditioningMonitoring: conditioningMonitering manyFeelingWanted: manyFeelingWantid rememberAppointments: rememberApointments certainSessionQualities: certainSessionQuaties @@ -614,13 +613,13 @@ certainAddress: certainAdress certainAdres addressRoutineDecided: addressRoutineDescided andBenefit: andBenifit correspondenceBonus: correspondenceBonas -recommendingAppreciatedDesiccate: recommendingAppreciatedDesicate recommendingAppreciatedDessicate recommendingAppreciatedDessiccate +appreciatedDesiccate: appreciatedDesicate appreciatedDessicate appreciatedDessiccate separateVariant: separateVairiant arrangementSeenBenefits: arrangementSeenBenifits particularCurrentlyLength: particularCurrentlyLengh transferredUniversally: transferredUniversaly ordinaryBuildingAssessing: ordinaryBuildingAccesing -geographicallyUnnecessarilyConditioning: geographicallyUnnecessarilyConditining +unnecessarilyConditioning: unnecessarilyConditining inconvenientTransportability: inconvenientTransportibility regainedBetweenVirtually: regainedBetweenVertually unexpectedAccountSurveying: unexpectedAccountServaying @@ -632,7 +631,6 @@ basicallyConditioning: basicallyConditining unequivocallyLocallyUseful: unequivocallyLocallyUsefull variableConsisting: variableConsisiting hierarchyReferenceRelevant: hierarchyReferenceRelavent hierarchyReferenceRelevaant -ideallyInconceivableMinuscule: ideallyInconceivableMiniscule unnecessarilyBeginningDecide: unnecessarilyBeginningDescide considerableAcademically: considerableAcademicly approachedSeenProvide: approachedSeenProvid @@ -654,7 +652,7 @@ builtDiscretion: builtDiscresion beforeThey: beforeThay reallyPermanently: reallyPerminantly governmentOpposite: governmentOpisite governmentOppasite governmentOppesite governmentOppisit governmentOppisite governmentOpposit governmentOppossite governmentOppossitte -separationAppointmentQuestionnaire: separationAppointmentQuestionaire +appointmentQuestionnaire: appointmentQuestionaire organizedRequested: organizedRquested acceptExplainingLiaison: acceptExplainingLiaision acceptExplainingLiason bicyclePronunciationEcstasy: bicyclePronunciationExstacy bicyclePronunciationEcstacy @@ -701,7 +699,7 @@ securityAdequateOperations: securityAdequateOperatins drivenPersonnel: drivenPersonnell interpretationFalseAnnoying: interpretationFalseAnoying eliminatedSafeguardConversely: eliminatedSafeguardConversly -functionallyConceivedStandardizing: functionallyConceivedStanerdizing +conceivedStandardizing: conceivedStanerdizing personnelAuxiliaryLevel: personnelAuxiliaryLevaal locallyPoemsMagnificent: locallyPoemsMagnificnet locallyPoemsMagificent locallyPoemsMagnifcent locallyPoemsMagnifecent locallyPoemsMagnifiscant locallyPoemsMagnifisent locallyPoemsMagnificant splendidOpinion: splendidOppinion @@ -715,7 +713,7 @@ auxiliaryVarietyHandle: auxiliaryVarietyHandell unionPriorAccommodation: unionPriorAccomodation unionPriorAcommodation unionPriorAcomodation variableSpeakingIndeed: variableSpeakingIndead plannedCriticismFeeling: plannedCriticismFealing -acquaintancesFavourableUnderstand: acquaintancesFavourableUndersand acquaintancesFavourableUndistand +favourableUnderstand: favourableUndersand favourableUndistand titlesUnavailable: titlesUnavailble voluntaryAgenciesTogether: voluntaryAgenciesTogehter argumentAnalysed: argumentAnalised @@ -735,7 +733,7 @@ ordinaryPatternsSegment: ordinaryPatternsSegemnt handleCriticism: handleCitisum umbrellaChapterPerhaps: umbrellaChapterPerhapse summariesProgression: summariesProgresion -interestingUnequivocallyAddressable: interestingUnequivocallyAddresable +unequivocallyAddressable: unequivocallyAddresable decisionResponsibilities: decisionResponsiblities clericalBetweenInterest: clericalBetweenIntrest accommodationRecentlyRecently: accommodationRecentlyReciently @@ -759,7 +757,7 @@ personnelRequiredAlthough: personnelRequiredAthough annoyingWill: annoyingWilll betweenDefinition: betweenDefenition decisionsAccounts: decisionsAcounts -academicallyUnnecessarilySecurity: academicallyUnnecessarilySeurity +unnecessarilySecurity: unnecessarilySeurity widelyStomach: widelyStomac widelyStomache widelyStomec widelyStumache summariesRecommending: summariesRecomending flexibleInconvenientSet: flexibleInconvenientSettt @@ -784,7 +782,7 @@ searchProgressionAddress: searchProgressionAdress searchProgressionAdres opinionSegmentSurroundings: opinionSegmentSuroundings opinionSegmentSeroundings comparisonYearsVariable: comparisonYearsVarible comparisonYearsVaiable applicableAccept: applicableAcept -especiallySuccessfulQuestionnaire: especiallySuccessfulQuestionare +successfulQuestionnaire: successfulQuestionare exactlyPretendUtilized: exactlyPretendUtalised movingParameters: movingPerametres analysingAdvantageousObtaining: analysingAdvantageousOptaning @@ -816,7 +814,7 @@ varietyCommit: varietyComit transportabilityWereSuffering: transportabilityWereSuufering thereforeUnionSimilar: thereforeUnionSimular earliestAre: earliestArre -chapterDefinitionDiagrammatically: chapterDefinitionDiagrammaticaally +definitionDiagrammatically: definitionDiagrammaticaally understandAtmosphereExpansion: understandAtmosphereExpanion experiencesInefficient: experiencesIneffiect understandGaining: understandGaning @@ -905,7 +903,7 @@ executedMatrix: executedMatriiix acceptedContented: acceptedContenpted acceptedContende acceptedContentid visitedProcedureAnnouncement: visitedProcedureAnouncement overallHierarchy: overallHeiarky -examinationOrganizationExperiences: examinationOrganizationExperances +organizationExperiences: organizationExperances rememberPoetryProviso: rememberPoetryProvisoe appliedBelieve: appliedBelive hierarchicalNationally: hierarchicalNationaly @@ -939,7 +937,7 @@ oppositeBeforeFavourable: oppositeBeforeFaverable receiveApologised: receiveAppologised advantageousTechniqueProceeding: advantageousTechniqueProceding decisionsFurther: decisionsFuther -inefficientUnnecessarilyNecessary: inefficientUnnecessarilyNecasery inefficientUnnecessarilyNessasary inefficientUnnecessarilyNessisary inefficientUnnecessarilyNeccassary +unnecessarilyNecessary: unnecessarilyNecasery unnecessarilyNessasary unnecessarilyNessisary unnecessarilyNeccassary scissorsLengthCorporate: scissorsLengthCorparate cemeteryConsist: cemeteryConsisit referenceConsistingVisitors: referenceConsistingVistors @@ -949,7 +947,7 @@ appealSupervision: appealSupervison functionallySenior: functionallySienior negligibleSurrounding: negligibleSerounding dataSummaries: dataSumarys -variableMinuscule: variableMiniscule +variableMinuscule: variableMuniscule whenFurtherSheets: whenFurtherSheertes enormouslyWithin: enormouslyWitin benefitsArranging: benefitsAranging diff --git a/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetPerformanceTest.kt b/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetPerformanceTest.kt index f7cbc2fbc5e4..cda9f683f254 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetPerformanceTest.kt +++ b/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetPerformanceTest.kt @@ -8,15 +8,15 @@ import com.intellij.tools.ide.metrics.benchmark.Benchmark class DataSetPerformanceTest: SpellcheckerInspectionTestCase() { - fun `test missp spellcheck performance`() { + fun `test misspelled words spellcheck performance`() { val manager = SpellCheckerManager.getInstance(project) - val total = Datasets.missp.flatMap { it.misspellings + it.word }.size + val total = Datasets.misspelling.flatMap { it.misspellings + it.word }.size - Benchmark.newBenchmark("highlight ${total} words in missp") { - for (word in Datasets.missp) { + Benchmark.newBenchmark("highlight ${total} misspelled words") { + for (word in Datasets.misspelling) { manager.hasProblem(word.word) - for (missp in word.misspellings) { - manager.hasProblem(missp) + for (misspelling in word.misspellings) { + manager.hasProblem(misspelling) } } }.start() @@ -29,8 +29,8 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() { Benchmark.newBenchmark("highlight ${total} words in words") { for (word in Datasets.words) { manager.hasProblem(word.word) - for (missp in word.misspellings) { - manager.hasProblem(missp) + for (misspelling in word.misspellings) { + manager.hasProblem(misspelling) } } }.start() @@ -44,8 +44,8 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() { Benchmark.newBenchmark("highlight ${total} words in camel-case") { for (word in Datasets.wordsCamelCase) { manager.hasProblem(word.word) - for (missp in word.misspellings) { - manager.hasProblem(missp) + for (misspelling in word.misspellings) { + manager.hasProblem(misspelling) } } }.start() diff --git a/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetQualityTest.kt b/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetQualityTest.kt index d1005afb318d..50b2f2c6d1e4 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetQualityTest.kt +++ b/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetQualityTest.kt @@ -2,33 +2,38 @@ package com.intellij.spellchecker.dataset import com.intellij.spellchecker.SpellCheckerManager +import com.intellij.spellchecker.dataset.Datasets.WordWithMisspellings import com.intellij.spellchecker.inspection.SpellcheckerInspectionTestCase -import org.junit.Assume +import org.junit.Assert.assertTrue +import org.junit.jupiter.api.assertAll +private const val MAX_WORD_LENGTH = 32 class DataSetQualityTest : SpellcheckerInspectionTestCase() { fun `test words spellcheck quality`() { - Assume.assumeFalse("This test is skipped on TeamCity", IS_UNDER_TEAMCITY) - - val manager = SpellCheckerManager.getInstance(project) - for (word in Datasets.words) { - assertFalse("${word.word} should not be misspelled, but it is", manager.hasProblem(word.word)) - for (missp in word.misspellings) { - assertTrue("${missp} should be misspelled, but it is not", manager.hasProblem(missp)) - } - } + doSpellcheckingTest(Datasets.words) } fun `test camel-case words spellcheck quality`() { - Assume.assumeFalse("This test is skipped on TeamCity", IS_UNDER_TEAMCITY) - - val manager = SpellCheckerManager.getInstance(project) - for (word in Datasets.wordsCamelCase) { - assertFalse("${word.word} should not be misspelled, but it is", manager.hasProblem(word.word)) - for (missp in word.misspellings) { - assertTrue("${missp} should be misspelled, but it is not", manager.hasProblem(missp)) - } - } + doSpellcheckingTest(Datasets.wordsCamelCase) } -} \ No newline at end of file + + private fun doSpellcheckingTest(dataset: List) { + val manager = SpellCheckerManager.getInstance(project) + assertAll(*dataset.flatMap { word -> + mutableListOf( + { assertFalse("${word.word} should not be misspelled, but it is", manager.hasProblem(word.word)) }, + { assertLessThanOrEqualMaxWordLength("${word.word} exceeds max word length $MAX_WORD_LENGTH", word.word.length) } + ) + + word.misspellings.map { misspelling -> + { assertTrue("$misspelling should be misspelled, but it is", manager.hasProblem(misspelling)) } + { assertLessThanOrEqualMaxWordLength("$misspelling exceeds max word length $MAX_WORD_LENGTH", misspelling.length) } + } + }.toTypedArray()) + } +} + +private fun assertLessThanOrEqualMaxWordLength(message: String, actual: Int) { + assertTrue(message, actual <= MAX_WORD_LENGTH) +} diff --git a/spellchecker/testSrc/com/intellij/spellchecker/dataset/Datasets.kt b/spellchecker/testSrc/com/intellij/spellchecker/dataset/Datasets.kt index 0eb8b27e0ab6..e582de4ebd31 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/dataset/Datasets.kt +++ b/spellchecker/testSrc/com/intellij/spellchecker/dataset/Datasets.kt @@ -10,7 +10,7 @@ object Datasets { WordWithMisspellings(word, LinkedHashSet(misspellings.split(" ").filter { it.isNotBlank() })) } - val missp: List by lazy { parseWordsFormat(getLines("/data/missp.dat")) } + val misspelling: List by lazy { parseWordsFormat(getLines("/data/missp.dat")) } val words: List by lazy { parseWordsFormat(getLines("/data/words.dat")) } val wordsCamelCase: List by lazy { parseWordsFormat(getLines("/data/words_camel_case.dat")) } } diff --git a/spellchecker/testSrc/com/intellij/spellchecker/inspection/CommentsWithMistakesInspectionTest.java b/spellchecker/testSrc/com/intellij/spellchecker/inspection/CommentsWithMistakesInspectionTest.java index 1236b4cead5b..67939950f693 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/inspection/CommentsWithMistakesInspectionTest.java +++ b/spellchecker/testSrc/com/intellij/spellchecker/inspection/CommentsWithMistakesInspectionTest.java @@ -15,9 +15,6 @@ */ package com.intellij.spellchecker.inspection; -import com.intellij.testFramework.UsefulTestCase; -import org.junit.Assume; - import java.util.Locale; /** @@ -49,7 +46,6 @@ public class CommentsWithMistakesInspectionTest extends SpellcheckerInspectionTe } public void testHtml() { - Assume.assumeFalse("This test is skipped on TeamCity", UsefulTestCase.IS_UNDER_TEAMCITY); doTest("test.html"); } diff --git a/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerCornerCasesTest.kt b/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerCornerCasesTest.kt index 7ea096abf5c8..f3c331510d5b 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerCornerCasesTest.kt +++ b/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerCornerCasesTest.kt @@ -2,16 +2,21 @@ package com.intellij.spellchecker.inspection import com.intellij.spellchecker.SpellCheckerManager -import org.junit.Assume class SpellcheckerCornerCasesTest : SpellcheckerInspectionTestCase() { fun `test a lot of mistakes in united word suggest`() { - Assume.assumeFalse("This test is skipped on TeamCity", IS_UNDER_TEAMCITY) + //should not end up with OOM + val manager = SpellCheckerManager.getInstance(project) + val suggestions = manager.getSuggestions("MYY_VERRY_LOOONG_WORDD_WOTH_OFFF") + assertTrue(suggestions.isNotEmpty()) + } + + fun `test suggestions are skipped if word is too long`() { //should not end up with OOM val manager = SpellCheckerManager.getInstance(project) val suggestions = manager.getSuggestions("MYY_VERRY_LOOONG_WORDD_WOTH_A_LOTTT_OFFF_MISAKES") - assertTrue(suggestions.isNotEmpty()) + assertTrue(suggestions.isEmpty()) } fun `test that korean language is treated as alien`() { diff --git a/spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java b/spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java index 53da672f92f5..2b6db89d450d 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java +++ b/spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java @@ -15,9 +15,6 @@ */ package com.intellij.spellchecker.inspection; -import com.intellij.testFramework.UsefulTestCase; -import org.junit.Assume; - /** * @author Ekaterina Shliakhovetskaja */ @@ -32,23 +29,19 @@ public class XmlWithMistakesInspectionTest extends SpellcheckerInspectionTestCas } public void testCharacterData() { - Assume.assumeFalse("This test is skipped on TeamCity", UsefulTestCase.IS_UNDER_TEAMCITY); doTest("test.html"); } public void testKnownAttributes() { - Assume.assumeFalse("This test is skipped on TeamCity", UsefulTestCase.IS_UNDER_TEAMCITY); doTest("attributes.html"); } public void testXsdEnumerations() { - Assume.assumeFalse("This test is skipped on TeamCity", UsefulTestCase.IS_UNDER_TEAMCITY); // "evenodd" is correct word in SVG, because it is known enumeration option in SVG doTest("enumerations.svg"); } public void testLinkIntegrity() { - Assume.assumeFalse("This test is skipped on TeamCity", UsefulTestCase.IS_UNDER_TEAMCITY); doTest("htmlIntegrity.html"); } } diff --git a/spellchecker/testSrc/com/intellij/spellchecker/inspection/quickfixes/XmlSpellCheckerFixesTest.java b/spellchecker/testSrc/com/intellij/spellchecker/inspection/quickfixes/XmlSpellCheckerFixesTest.java index c2840220012f..4b4bb6530c80 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/inspection/quickfixes/XmlSpellCheckerFixesTest.java +++ b/spellchecker/testSrc/com/intellij/spellchecker/inspection/quickfixes/XmlSpellCheckerFixesTest.java @@ -15,9 +15,6 @@ */ package com.intellij.spellchecker.inspection.quickfixes; -import com.intellij.testFramework.UsefulTestCase; -import org.junit.Assume; - public class XmlSpellCheckerFixesTest extends AbstractSpellCheckerFixesTest { @Override protected String getExtension() { @@ -29,7 +26,6 @@ public class XmlSpellCheckerFixesTest extends AbstractSpellCheckerFixesTest { } public void testInjectionChangeTo() { - Assume.assumeFalse("This test is skipped on TeamCity", UsefulTestCase.IS_UNDER_TEAMCITY); doChangeToTest(); } }