package nl.utwente.group10.haskell.catalog;

import nl.utwente.group10.haskell.env.Env;
import nl.utwente.group10.haskell.exceptions.CatalogException;
import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class HaskellCatalogTest {
    @Test
    public void basicCatalogTest() throws CatalogException {
        HaskellCatalog c = new HaskellCatalog();

        // getCategories
        assertFalse(c.getCategories().isEmpty());
        assertTrue(c.getCategories().contains("Math"));

        // asEnvironment
        Env e = c.asEnvironment();
        assertFalse(e.getExprTypes().isEmpty());
        assertFalse(e.getTypeClasses().isEmpty());
        assertTrue(e.getExprTypes().containsKey("id"));
        assertTrue(e.getTypeClasses().containsKey("Num"));
    }
}

@@ -537,12 +537,13 @@
 ns(%22
-Math
+Basic
 %22));
@@ -815,20 +815,79 @@
 ey(%22Num%22));%0A
+        assertTrue(e.getFreshExprType(%22(+)%22).isPresent());%0A
     %7D%0A%7D%0A

Fix HaskellCatalogTest to work with new categories