public void testPopSortFromFile() throws IOException
{
@SuppressWarnings("unused")
String line = "";
FileReader myFileReader = new FileReader
("com/liyingcheng/testFiles/TestPopSort.txt");//相对路径
BufferedReader myBufferedReader=new BufferedReader(myFileReader);
while((line = myBufferedReader.readLine())!=null)
{
if(line.startsWith("#"))
{
continue;
}
String[] tokens = line.split(",");
int[] actual = {Integer.parseInt(tokens[0]),Integer.parseInt(tokens[1]),Integer.parseInt(tokens[2])};
int[] expected = {Integer.parseInt(tokens[3]),Integer.parseInt(tokens[4]),Integer.parseInt(tokens[5])};
testSinglePopSort(expected,actual);
}
}
|