- Timestamp:
- 02/21/08 18:54:15 (4 years ago)
- File:
-
- 1 edited
-
trunk/src/tests_test.erl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tests_test.erl
r19 r20 19 19 filtering_tests_returns_list_of_funs_from_unloaded_binary () -> 20 20 File_name = "../fix/eg_test.erl", 21 Binary = modules: to_binary (File_name), 22 false = code: is_loaded (eg_test), 23 [Ok, Nok] = tests: filter_by_attribute (Binary), 24 try 25 {module, eg_test} = code: load_binary (eg_test, File_name, Binary), 26 ok = Ok (), 27 {'EXIT', {{badmatch, nok}, _}} = (catch Nok ()) 28 after 29 code: purge (eg_test), 30 code: delete (eg_test) 31 end. 21 Test = fun ([Ok, Nok]) -> 22 ok = Ok (), 23 {'EXIT', {{badmatch, nok}, _}} = (catch Nok ()) 24 end, 25 filtering (File_name, eg_test, Test). 32 26 33 27 filtering_fixtured_tests_returns_list_of_fixture_fun_tuples () -> 34 28 File_name = "../fix/eg_test_with_fixture.erl", 29 Test = fun ([{Module, Fixture, Tests}]) -> 30 [ok] = Module: Fixture (Tests) 31 end, 32 filtering (File_name, eg_test_with_fixture, Test). 33 34 filtering (File_name, Module, Test) -> 35 35 Binary = modules: to_binary (File_name), 36 [{Module, Fixture, Tests}] = tests: filter_by_attribute (Binary), 36 false = code: is_loaded (Module), 37 Tests = tests: filter_by_attribute (Binary), 37 38 try 38 {module, eg_test_with_fixture} = 39 code: load_binary (eg_test_with_fixture, File_name, Binary), 40 [ok] = Module:Fixture (Tests) 39 {module, Module} = code: load_binary (Module, File_name, Binary), 40 Test (Tests) 41 41 after 42 code: purge ( eg_test_with_fixture),43 code: delete ( eg_test_with_fixture)42 code: purge (Module), 43 code: delete (Module) 44 44 end. 45
Note: See TracChangeset
for help on using the changeset viewer.
