This is an automated email from the ASF dual-hosted git repository.

justinchen pushed a commit to branch object-name-fix
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/object-name-fix by this push:
     new ab27d52f8e7 windows
ab27d52f8e7 is described below

commit ab27d52f8e75596be34ad475100e425c137385d8
Author: Caideyipi <[email protected]>
AuthorDate: Mon Jan 5 17:10:20 2026 +0800

    windows
---
 .../iotdb/commons/utils/WindowsOSUtilsTest.java    | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git 
a/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/utils/WindowsOSUtilsTest.java
 
b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/utils/WindowsOSUtilsTest.java
new file mode 100644
index 00000000000..bbe847b6f8e
--- /dev/null
+++ 
b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/utils/WindowsOSUtilsTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.commons.utils;
+
+import org.apache.tsfile.external.commons.lang3.SystemUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+import static 
org.apache.iotdb.commons.utils.WindowsOSUtils.isLegalPathSegment4Windows;
+
+public class WindowsOSUtilsTest {
+  @Test
+  public void testIllegalDetection() {
+    if (!SystemUtils.IS_OS_WINDOWS) {
+      return;
+    }
+    Assert.assertTrue(isLegalPathSegment4Windows("abc"));
+    Assert.assertTrue(isLegalPathSegment4Windows(".A!"));
+
+    Assert.assertFalse(isLegalPathSegment4Windows("C."));
+    Assert.assertFalse(isLegalPathSegment4Windows("a:b<|"));
+    Assert.assertFalse(isLegalPathSegment4Windows("COM1"));
+  }
+}

Reply via email to