Add settings copy unit coverage
This commit is contained in:
@@ -27,7 +27,7 @@ class LoggingRuleStore(context: Context) {
|
||||
}
|
||||
|
||||
fun copy(from: LoggingType, targets: Set<LoggingType>) {
|
||||
val source = ruleFor(from)
|
||||
val source = ruleFor(from).copyForTarget()
|
||||
preferences.edit {
|
||||
targets.filterNot { it == from }.forEach { target ->
|
||||
write(target, source.copy(selectedPackages = source.selectedPackages.toSet()))
|
||||
@@ -50,3 +50,5 @@ class LoggingRuleStore(context: Context) {
|
||||
const val FILE_NAME = "logging-rules"
|
||||
}
|
||||
}
|
||||
|
||||
internal fun LoggingRule.copyForTarget(): LoggingRule = copy(selectedPackages = selectedPackages.toSet())
|
||||
|
||||
Reference in New Issue
Block a user