/*
 * 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.commons.io;

import java.util.Arrays;

import org.junit.Assert;
import org.junit.Test;

public class FileSystemTestCase {

    @Test
    public void testToLegalFileNameWindows() {
        FileSystem fs = FileSystem.WINDOWS;
        char replacement = '-';
        for (char i = 0; i < 32; i++) {
            Assert.assertEquals(replacement, fs.toLegalFileName(String.valueOf(i), replacement).charAt(0));
        }
        char[] illegal = new char[] { '<', '>', ':', '"', '/', '\\', '|', '?', '*' };
        Arrays.sort(illegal);
        System.out.println(Arrays.toString(illegal));
        for (char i = 0; i < illegal.length; i++) {
            Assert.assertEquals(replacement, fs.toLegalFileName(String.valueOf(i), replacement).charAt(0));
        }
        for (char i = 'a'; i < 'z'; i++) {
            Assert.assertEquals(i, fs.toLegalFileName(String.valueOf(i), replacement).charAt(0));
        }
        for (char i = 'A'; i < 'Z'; i++) {
            Assert.assertEquals(i, fs.toLegalFileName(String.valueOf(i), replacement).charAt(0));
        }
        for (char i = '0'; i < '9'; i++) {
            Assert.assertEquals(i, fs.toLegalFileName(String.valueOf(i), replacement).charAt(0));
        }
    }
}

@@ -833,34 +833,8 @@
 o;%0A%0A
-import java.util.Arrays;%0A%0A
 impo
@@ -854,16 +854,16 @@
 Assert;%0A
+
 import o
@@ -913,16 +913,323 @@
 Case %7B%0A%0A
+    @Test%0A    public void testSorted() %7B%0A        for (FileSystem fs : FileSystem.values()) %7B%0A            char%5B%5D chars=fs.getIllegalFileNameChars();%0A            for (int i=0; i %3C chars.length - 1; i++) %7B%0A                Assert.assertTrue(fs.name(), chars%5Bi%5D %3C chars%5Bi+1%5D);%0A            %7D%0A        %7D%0A    %7D    %0A%0A
     @Tes
@@ -1503,32 +1503,32 @@
 (0));%0A        %7D%0A
+
         char%5B%5D i
@@ -1601,92 +1601,8 @@
  %7D;%0A
-        Arrays.sort(illegal);%0A        System.out.println(Arrays.toString(illegal));%0A
     

Test if arrays are sorted