z481_vars_compile_tst.java 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. XOWA: the XOWA Offline Wiki Application
  3. Copyright (C) 2012-2017 gnosygnu@gmail.com
  4. XOWA is licensed under the terms of the General Public License (GPL) Version 3,
  5. or alternatively under the terms of the Apache License Version 2.0.
  6. You may use XOWA according to either of these licenses as is most appropriate
  7. for your project on a case-by-case basis.
  8. The terms of each license can be found in the source code repository:
  9. GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
  10. Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
  11. */
  12. package gplx.gfml; import gplx.*;
  13. import org.junit.*;
  14. public class z481_vars_compile_tst {
  15. @Before public void setup() {
  16. regy = fx.Regy();
  17. pragma = GfmlPragmaVar.new_();
  18. fx.run_InitPragma(regy, pragma);
  19. } GfmlTypeCompiler_fxt fx = GfmlTypeCompiler_fxt.new_(); GfmlTypRegy regy; GfmlPragmaVar pragma;
  20. @Test public void Text1() {
  21. GfmlNde gnde = fx.run_Resolve(regy, "_var/text"
  22. , fx.nde_().Atru_("key_test").Atru_("val_test").Atru_("context_test"));
  23. GfmlVarItm itm = pragma.CompileItmNde(gnde);
  24. Tfds.Eq_rev(itm.Key(), "key_test");
  25. Tfds.Eq_rev(itm.TknVal(), "val_test");
  26. Tfds.Eq_rev(itm.CtxKey(), "context_test");
  27. }
  28. }