You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.2 KiB

  1. const tester = require("../c/buildasm/buildzqfieldtester2.js");
  2. const bigInt = require("big-integer");
  3. const __P__ = new bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");
  4. describe("basic cases", function () {
  5. this.timeout(100000);
  6. it("should do basic tests", async () => {
  7. await tester(__P__, [
  8. ["add", 0, 0],
  9. ["add", 0, 1],
  10. ["add", 1, 0],
  11. ["add", 1, 1],
  12. ["add", 2, 1],
  13. ["add", 2, 10],
  14. ["add", -1, -1],
  15. ["add", -20, -10],
  16. ["add", "10604728079509999371218483608188593244163417117449316147628604036713980815027", "10604728079509999371218483608188593244163417117449316147628604036713980815027"],
  17. ["mul", 0, 0],
  18. ["mul", 0, 1],
  19. ["mul", 1, 0],
  20. ["mul", 1, 1],
  21. ["mul", 2, 1],
  22. ["mul", 2, 10],
  23. ["mul", -1, -1],
  24. ["mul", -20, -10],
  25. ["mul", "10604728079509999371218483608188593244163417117449316147628604036713980815027", "10604728079509999371218483608188593244163417117449316147628604036713980815027"],
  26. ]);
  27. });
  28. });