Enhance error handling with exceptions and add tests
This commit is contained in:
10
tests/error_data/duplicate_attributes.arff
Normal file
10
tests/error_data/duplicate_attributes.arff
Normal file
@@ -0,0 +1,10 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 real
|
||||
@attribute feature2 real
|
||||
@attribute feature1 real
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
1.0,2.0,3.0,A
|
||||
4.0,5.0,6.0,B
|
9
tests/error_data/empty_attribute_name.arff
Normal file
9
tests/error_data/empty_attribute_name.arff
Normal file
@@ -0,0 +1,9 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 real
|
||||
@attribute real
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
1.0,2.0,A
|
||||
4.0,5.0,B
|
9
tests/error_data/empty_attribute_type.arff
Normal file
9
tests/error_data/empty_attribute_type.arff
Normal file
@@ -0,0 +1,9 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 real
|
||||
@attribute feature2
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
1.0,2.0,A
|
||||
4.0,5.0,B
|
7
tests/error_data/empty_attributes.arff
Normal file
7
tests/error_data/empty_attributes.arff
Normal file
@@ -0,0 +1,7 @@
|
||||
@relation test
|
||||
|
||||
% This file has no attributes defined
|
||||
|
||||
@data
|
||||
1,2,3
|
||||
4,5,6
|
10
tests/error_data/empty_categorical.arff
Normal file
10
tests/error_data/empty_categorical.arff
Normal file
@@ -0,0 +1,10 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 {X,Y,Z}
|
||||
@attribute feature2 real
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
X,2.0,A
|
||||
,5.0,B
|
||||
Z,8.0,A
|
10
tests/error_data/empty_class_label.arff
Normal file
10
tests/error_data/empty_class_label.arff
Normal file
@@ -0,0 +1,10 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 real
|
||||
@attribute feature2 real
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
1.0,2.0,A
|
||||
4.0,5.0,
|
||||
7.0,8.0,B
|
10
tests/error_data/invalid_numeric.arff
Normal file
10
tests/error_data/invalid_numeric.arff
Normal file
@@ -0,0 +1,10 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 real
|
||||
@attribute feature2 real
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
1.0,2.0,A
|
||||
not_a_number,5.0,B
|
||||
3.0,4.0,A
|
8
tests/error_data/no_data.arff
Normal file
8
tests/error_data/no_data.arff
Normal file
@@ -0,0 +1,8 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 real
|
||||
@attribute feature2 real
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
% No actual data samples
|
10
tests/error_data/quoted_question_mark.arff
Normal file
10
tests/error_data/quoted_question_mark.arff
Normal file
@@ -0,0 +1,10 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 string
|
||||
@attribute feature2 real
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
"What is this?",2.0,A
|
||||
"Another question?",5.0,B
|
||||
"No question",8.0,A
|
10
tests/error_data/wrong_token_count.arff
Normal file
10
tests/error_data/wrong_token_count.arff
Normal file
@@ -0,0 +1,10 @@
|
||||
@relation test
|
||||
|
||||
@attribute feature1 real
|
||||
@attribute feature2 real
|
||||
@attribute class {A,B}
|
||||
|
||||
@data
|
||||
1.0,2.0,A
|
||||
4.0,5.0,6.0,B,extra
|
||||
7.0,C
|
Reference in New Issue
Block a user