Search in sources :

Example 1 with DefineOption

use of org.erlide.core.builder.CompilerOption.DefineOption in project erlide_eclipse by erlang.

the class CompilerOptionTest method testToTerm_5a.

@Test
public void testToTerm_5a() throws OtpParserException {
    final DefineOption option = CompilerOptions.DEFINE;
    @SuppressWarnings("unchecked") final List<Pair<String, String>> values = Lists.newArrayList(new Pair<>("Macro", ""));
    final OtpErlangObject actual = option.toTerm(values);
    final String expected = "[{d,'Macro'}]";
    Assert.assertEquals(expected, actual.toString());
}
Also used : DefineOption(org.erlide.core.builder.CompilerOption.DefineOption) OtpErlangObject(com.ericsson.otp.erlang.OtpErlangObject) Pair(org.eclipse.xtext.xbase.lib.Pair) Test(org.junit.Test)

Example 2 with DefineOption

use of org.erlide.core.builder.CompilerOption.DefineOption in project erlide_eclipse by erlang.

the class CompilerOptionTest method testToTerm_5.

@Test
public void testToTerm_5() throws OtpParserException {
    final DefineOption option = CompilerOptions.DEFINE;
    @SuppressWarnings("unchecked") final List<Pair<String, String>> values = Lists.newArrayList(new Pair<>("Macro", "[hej,1]"));
    final OtpErlangObject actual = option.toTerm(values);
    final String expected = "[{d,'Macro',[hej,1]}]";
    Assert.assertEquals(expected, actual.toString());
}
Also used : DefineOption(org.erlide.core.builder.CompilerOption.DefineOption) OtpErlangObject(com.ericsson.otp.erlang.OtpErlangObject) Pair(org.eclipse.xtext.xbase.lib.Pair) Test(org.junit.Test)

Aggregations

OtpErlangObject (com.ericsson.otp.erlang.OtpErlangObject)2 Pair (org.eclipse.xtext.xbase.lib.Pair)2 DefineOption (org.erlide.core.builder.CompilerOption.DefineOption)2 Test (org.junit.Test)2