diff -r b4def82f3f9f -r 166bb9b6b20a testing/alcohol_test2.scala --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testing/alcohol_test2.scala Tue Nov 07 14:17:21 2017 +0000 @@ -0,0 +1,17 @@ + +import io.Source +import scala.util._ + +val file_population_test = "population.csv" +val file_alcohol_test = "alcohol.csv" + + +def get_csv_file_test(file: String) : List[String] = + Source.fromFile(file)("ISO-8859-1").getLines.toList + +val alcs_test = get_csv_file_test(file_alcohol_test) +val pops_test = get_csv_file_test(file_population_test) + +assert(CW6b.process_alcs(alcs_test.drop(1))(0) == ("Afghanistan", 0.0)) + +assert(CW6b.process_pops(pops_test.drop(1))("Micronesia") == 104015)