How to import code in SML?

I am currently evaluating assignments for an SML course. I wrote some test cases to automatically check the correctness of the functions in the student assignments, and I would like to be able to import their code, and then run test cases with this code. I present something similar to python import semantics. Right now, the best solution I have is to copy this code at the bottom of each job. Is this possible with SML?

+4
source share
2 answers

Use use :

 use "filename.sml"; (* your test cases here *) 

If you have a solution for students in "student.sml" and your test cases in "tests.sml":

 use "student.sml"; use "tests.sml"; 
+6
source

Check out QCheck , a unit test library for SML

+2
source

Source: https://habr.com/ru/post/1337689/


All Articles