Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Nov 7, 2024
1 parent 34fa2fb commit 5f7da98
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
10 changes: 10 additions & 0 deletions crates/rspack_core/src/dependency/runtime_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,16 @@ mod test_items_to_regexp {
),
"[1234a]".to_string()
);

assert_eq!(
items_to_regexp(
vec!["foo_js", "_js"]
.into_iter()
.map(String::from)
.collect::<Vec<_>>(),
),
"(|foo)_js".to_string()
);
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions crates/rspack_core/src/utils/compile_boolean_matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,11 @@ fn get_common_suffix<'a, I: Iterator<Item = &'a str>>(mut items: I) -> &'a str {
let item_byte = item[p - 1];
if suffix_byte == item_byte {
p -= 1;
} else {
suffix = &suffix[s + 1..];
break;
continue;
}
}
suffix = &suffix[s + 1..];
break;
}
}

Expand Down
26 changes: 13 additions & 13 deletions tests/webpack-test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ module.exports = {
// "<rootDir>/Chunk.unittest.js",
// "<rootDir>/Cli.basictest.js",
// "<rootDir>/Compiler-caching.test.js",
"<rootDir>/Compiler.test.js",
// "<rootDir>/Compiler.test.js",
// "<rootDir>/ConfigCacheTestCases.longtest.js",
"<rootDir>/ConfigTestCases.basictest.js",
// "<rootDir>/ContextModule.unittest.js",
// "<rootDir>/ContextModuleFactory.unittest.js",
// "<rootDir>/Defaults.unittest.js",
// "<rootDir>/Errors.test.js",
"<rootDir>/Examples.test.js",
// "<rootDir>/Examples.test.js",
// "<rootDir>/FileSystemInfo.unittest.js",
// "<rootDir>/HotModuleReplacementPlugin.test.js",
"<rootDir>/HotTestCasesAsyncNode.test.js",
"<rootDir>/HotTestCasesNode.test.js",
"<rootDir>/HotTestCasesWeb.test.js",
"<rootDir>/HotTestCasesWebWorker.test.js",
// "<rootDir>/HotTestCasesAsyncNode.test.js",
// "<rootDir>/HotTestCasesNode.test.js",
// "<rootDir>/HotTestCasesWeb.test.js",
// "<rootDir>/HotTestCasesWebWorker.test.js",
// "<rootDir>/JavascriptParser.unittest.js",
// "<rootDir>/LazySet.unittest.js",
// "<rootDir>/LocalModulesHelpers.unittest.js",
// "<rootDir>/MemoryLimitTestCases.test.js",
// "<rootDir>/ModuleDependencyError.unittest.js",
"<rootDir>/MultiCompiler.test.js",
// "<rootDir>/MultiCompiler.test.js",
// "<rootDir>/MultiItemCache.unittest.js",
"<rootDir>/MultiStats.test.js",
// "<rootDir>/MultiStats.test.js",
// "<rootDir>/MultiWatching.unittest.js",
// "<rootDir>/NodeTemplatePlugin.test.js",
// "<rootDir>/NormalModule.unittest.js",
Expand All @@ -55,8 +55,8 @@ module.exports = {
// "<rootDir>/SideEffectsFlagPlugin.unittest.js",
// "<rootDir>/SizeFormatHelpers.unittest.js",
// "<rootDir>/SortableSet.unittest.js",
"<rootDir>/Stats.test.js",
"<rootDir>/StatsTestCases.basictest.js",
// "<rootDir>/Stats.test.js",
// "<rootDir>/StatsTestCases.basictest.js",
// "<rootDir>/Template.unittest.js",
// "<rootDir>/TestCasesAllCombined.longtest.js",
// "<rootDir>/TestCasesCachePack.longtest.js",
Expand All @@ -71,10 +71,10 @@ module.exports = {
// "<rootDir>/TestCasesDevtoolInlineCheapSourceMap.test.js",
// "<rootDir>/TestCasesDevtoolInlineSourceMap.longtest.js",
// "<rootDir>/TestCasesDevtoolSourceMap.longtest.js",
"<rootDir>/TestCasesHot.test.js",
// "<rootDir>/TestCasesHot.test.js",
// "<rootDir>/TestCasesMinimizedSourceMap.longtest.js",
// "<rootDir>/TestCasesModule.test.js",
"<rootDir>/TestCasesNormal.basictest.js",
// "<rootDir>/TestCasesNormal.basictest.js",
// "<rootDir>/TestCasesProdGlobalUsed.test.js",
// "<rootDir>/TestCasesProduction.longtest.js",
// "<rootDir>/URLAbsoluteSpecifier.unittest.js",
Expand All @@ -85,7 +85,7 @@ module.exports = {
// "<rootDir>/WatchClose.test.js",
// "<rootDir>/WatchDetection.test.js",
// "<rootDir>/WatchSuspend.test.js",
"<rootDir>/WatchTestCases.longtest.js",
// "<rootDir>/WatchTestCases.longtest.js",
// "<rootDir>/WatcherEvents.test.js",
// "<rootDir>/WebpackError.unittest.js",
// "<rootDir>/cleverMerge.unittest.js",
Expand Down

0 comments on commit 5f7da98

Please sign in to comment.