1- test_that(" Reading a spreadsheet map works" , {
1+ test_that(" Reading a valid guide with platedata works" , {
22 expect_no_error(read_guide(test_path(" fixtures/guide_competition_1_0.yml" )))
33})
44
5+ test_that(" Reading a valid guide without platedata works" , {
6+ expect_no_error(read_guide(test_path(
7+ " fixtures/goodguides/guide_without_platedata.yml"
8+ )))
9+ })
10+
511test_that(" Function check_dim works" , {
612 expect_no_error(check_dim(" A1:B1" , NA , 2 ))
713 expect_no_error(check_dim(" A1:C10" , 10 , 3 ))
@@ -11,9 +17,61 @@ test_that("Function check_dim works", {
1117 expect_error(check_dim(" A1:C3" , NA , NA ))
1218})
1319
14- # test_that("check_guide works for correct guides", {
15- # expect_no_error(read_guide(test_path("fixtures/goodguides/guide_competition_9_3.yml")))
16- # expect_no_error(read_guide(test_path("fixtures/goodguides/guide_without_platedata.yml")))
17- # expect_no_error(read_guide(test_path("fixtures/goodguides/guide_with_two_plates.yml")))
18- # expect_no_error(read_guide(test_path("fixtures/goodguides/guide_without_templatemetadata.yml")))
19- # })
20+ test_that(" check_guide: missing plate.format when platedata is present yields an error" , {
21+ expect_error(
22+ read_guide(test_path(" fixtures/erroneousguides/missing_plate_format.yml" )),
23+ regexp = " plate.format"
24+ )
25+ })
26+
27+ test_that(" check_guide: invalid plate.format value yields an error" , {
28+ expect_error(
29+ read_guide(test_path(" fixtures/erroneousguides/invalid_plate_format.yml" )),
30+ regexp = " plate format"
31+ )
32+ })
33+
34+ test_that(" check_guide: wrong platedata range dimensions yield an error" , {
35+ expect_error(
36+ read_guide(test_path(
37+ " fixtures/erroneousguides/invalid_platedata_range.yml"
38+ )),
39+ regexp = " required dimensions"
40+ )
41+ })
42+
43+ test_that(" check_guide: guide without a .template location yields an error" , {
44+ expect_error(
45+ read_guide(test_path(
46+ " fixtures/erroneousguides/missing_template_location.yml"
47+ )),
48+ regexp = " \\ .template"
49+ )
50+ })
51+
52+ test_that(" read_guide: duplicate long names in translations yield an error" , {
53+ expect_error(
54+ read_guide(test_path(
55+ " fixtures/erroneousguides/duplicate_long_translations.yml"
56+ )),
57+ regexp = " Duplicate keys in long"
58+ )
59+ })
60+
61+ test_that(" read_guide: duplicate short names in translations yield an error" , {
62+ expect_error(
63+ read_guide(test_path(
64+ " fixtures/erroneousguides/duplicate_short_translations.yml"
65+ )),
66+ regexp = " Duplicate keys in short"
67+ )
68+ })
69+
70+ test_that(" read_guide: reserved 'File path' long name mapped to non-.sourcefile short name yields an error" , {
71+ expect_error(
72+ read_guide(test_path(
73+ " fixtures/erroneousguides/reserved_filepath_translation.yml"
74+ )),
75+ regexp = " File path"
76+ )
77+ })
0 commit comments