Flags.hx 989 B

123456789101112131415161718192021222324252627
  1. import haxe.macro.Context;
  2. function main() {
  3. // set with dash
  4. if (!Context.defined("f-dash"))
  5. throw "`f-dash` flag is missing";
  6. if (!Context.defined("f_dash"))
  7. throw "`f_dash` flag is missing";
  8. // set with underscore
  9. if (!Context.defined("f-underscore"))
  10. throw "`f-underscore` flag is missing";
  11. if (!Context.defined("f_underscore"))
  12. throw "`f_underscore` flag is missing";
  13. // value set with dash
  14. if (Context.definedValue("v-dash") != "value")
  15. throw "`v-dash` flag has incorrect value: " + Context.definedValue("v-dash");
  16. if (Context.definedValue("v_dash") != "value")
  17. throw "`v_dash` flag has incorrect value" + Context.definedValue("v_dash");
  18. // value set with underscore
  19. if (Context.definedValue("v-underscore") != "value")
  20. throw "`v-underscore` flag has incorrect value" + Context.definedValue("v-underscore");
  21. if (Context.definedValue("v_underscore") != "value")
  22. throw "`v_underscore` flag has incorrect value" + Context.definedValue("v-underscore");
  23. }