启动时在日志中记录 CPU 信息 (#3914)
This commit is contained in:
@@ -5,6 +5,7 @@ import org.junit.jupiter.api.Test;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.jackhuang.hmcl.util.Pair.pair;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
@@ -12,7 +13,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
/**
|
||||
* @author Glavo
|
||||
*/
|
||||
public final class KeyValuePairPropertiesTest {
|
||||
public final class KeyValuePairUtilsTest {
|
||||
@Test
|
||||
public void test() throws IOException {
|
||||
String content = "#test: key0=value0\n \n" +
|
||||
@@ -20,7 +21,7 @@ public final class KeyValuePairPropertiesTest {
|
||||
"key2=\"value2\"\n" +
|
||||
"key3=\"\\\" \\n\"\n";
|
||||
|
||||
KeyValuePairProperties properties = KeyValuePairProperties.load(new BufferedReader(new StringReader(content)));
|
||||
Map<String, String> properties = KeyValuePairUtils.loadProperties(new BufferedReader(new StringReader(content)));
|
||||
|
||||
assertEquals(Lang.mapOf(
|
||||
pair("key1", "value1"),
|
||||
@@ -99,15 +99,15 @@ public final class WinRegTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryKeys() {
|
||||
public void testQuerySubKeys() {
|
||||
WinReg.HKEY hkey = WinReg.HKEY.HKEY_CURRENT_USER;
|
||||
WinReg reg = WinReg.INSTANCE;
|
||||
|
||||
assertEquals(Arrays.asList(SUBKEYS).stream().map(it -> key + "\\" + it).collect(Collectors.toList()),
|
||||
reg.queryKeys(hkey, key).stream().sorted().collect(Collectors.toList()));
|
||||
reg.querySubKeys(hkey, key).stream().sorted().collect(Collectors.toList()));
|
||||
for (String subkey : SUBKEYS) {
|
||||
assertEquals(Collections.emptyList(), reg.queryKeys(hkey, key + "\\" + subkey));
|
||||
assertEquals(Collections.emptyList(), reg.querySubKeys(hkey, key + "\\" + subkey));
|
||||
}
|
||||
assertEquals(Collections.emptyList(), reg.queryKeys(hkey, key + "\\NOT_EXIST"));
|
||||
assertEquals(Collections.emptyList(), reg.querySubKeys(hkey, key + "\\NOT_EXIST"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user