LTS: firmware matcher needs to learn to migrate
#5015 relevant helper method
This commit is contained in:
parent
ba0527a905
commit
df3f924dc5
|
@ -2,5 +2,11 @@ plugins {
|
|||
id 'java'
|
||||
}
|
||||
|
||||
apply from: '../../android/dependencies.gradle'
|
||||
|
||||
// TODO: rename folder to core_io
|
||||
// this CORE module cannot depend on model/ini!
|
||||
// this CORE module cannot depend on model/ini!
|
||||
|
||||
dependencies {
|
||||
testImplementation global_libs.junit
|
||||
}
|
|
@ -35,4 +35,13 @@ public class BundleUtil {
|
|||
bundle = bundle == null ? "unknown bundle" : bundle;
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public static String getBundleTarget(String s) {
|
||||
if (s == null)
|
||||
return null;
|
||||
int lastDot = s.lastIndexOf('.');
|
||||
if (lastDot == -1)
|
||||
throw new IllegalStateException("Dot expected somewhere in [" + s + "]");
|
||||
return s.substring(lastDot + 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.rusefi.core.io;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class BundleUtilTest {
|
||||
@Test
|
||||
public void testExtractBundleTarget() {
|
||||
assertEquals("proteus_f7", BundleUtil.getBundleTarget("rusefi.snapshot.proteus_f7"));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue