我試圖測試從磁盤加載文件並對其進行一些操作的函數。我將我的項目分爲src /和test /目錄。我把test文件放在test /目錄下,並嘗試運行加載這個文件的單元測試。但是,從IDE(IntelliJ)或使用鋼筋的控制檯運行測試時,文件似乎不可見。哪裏可以放置eunit的測試文件?
$ ./rebar eunit
==> traffic-emas (eunit)
input_test: load_from_file_test...*failed*
in function input:load_intersection_definition/1 (src/input.erl, line 40)
in call from input_test:load_from_file_test/0 (test/input_test.erl, line 14)
**error:{badmatch,{error,enoent}}
我應該在哪裏放置eunit的測試文件使其可見?
它沒有幫助。測試仍然無法看到文件。在Java中,我只需將測試文件添加到src/test/resources中,並在Unit Test中使用classloader加載它。 Erlang有類似的東西嗎? – slakomy