Skip to content

Update epScript test files#36

Open
zuhanit wants to merge 1 commit intoarmoha:mainfrom
zuhanit:fix/update-epscript-tests
Open

Update epScript test files#36
zuhanit wants to merge 1 commit intoarmoha:mainfrom
zuhanit:fix/update-epscript-tests

Conversation

@zuhanit
Copy link
Contributor

@zuhanit zuhanit commented Mar 6, 2026

795f8304 and d44a6504 changes epScript, but test files are not updated.

Who needs update

https://github.com/armoha/eudplib/blob/main/src/epscript/test/parser/test_complex.cpp
https://github.com/armoha/eudplib/blob/main/src/epscript/test/parser/test_ctrlstru.cpp
https://github.com/armoha/eudplib/blob/main/src/epscript/test/parser/test_globalv.cpp
https://github.com/armoha/eudplib/blob/main/src/epscript/test/parser/test_debuginfo.cpp
https://github.com/armoha/eudplib/blob/main/src/epscript/test/parser/test_staticv.cpp

Test Result

Before

/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_complex.cpp:7
...............................................................................

/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_complex.cpp:34: FAILED:
  CHECK( trim(ParseString("<test>", "var a = 1;\n" "const b = 2;\n" "\n" "function x() {\n" "    const A = 1;\n" "    A.B();  // Should not have f_A prefix\n" "    dwread();  // Should have f_ prefix\n" "\n" "    var a = dwread()[[5]];\n" "    a = A[5];\n" "    A[a] = 7;\n" "}", false)) == trim("a = EUDCreateVariables(1)\n" "_IGVA([a], lambda: [1])\n" "b = _CGFW(lambda: [2], 1)[0]\n" "@EUDFunc\n" "def f_x():\n" "    A = 1\n" "    A.B()\n" "    f_dwread()\n" "    a_1 = EUDVariable()\n" "    a_1 << (f_dwread()[5])\n" "    a_1 << (A[5])\n" "    _ARRW(A, a_1) << (7)\n") )
with expansion:
  "a = _TYGV([None], lambda: [1])
  b = _CGFW(lambda: [2], 1)[0]
  @EUDFunc
  def f_x():
      A = 1
      A.B()
      f_dwread()
      a_1 = _TYLV([None], [f_dwread()[5]])
      a_1 << (A[5])
      _ARRW(A, a_1) << (7)"
  ==
  "a = EUDCreateVariables(1)
  _IGVA([a], lambda: [1])
  b = _CGFW(lambda: [2], 1)[0]
  @EUDFunc
  def f_x():
      A = 1
      A.B()
      f_dwread()
      a_1 = EUDVariable()
      a_1 << (f_dwread()[5])
      a_1 << (A[5])
      _ARRW(A, a_1) << (7)"

-------------------------------------------------------------------------------
Control block parsing
  Once
-------------------------------------------------------------------------------
/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_ctrlstru.cpp:8
...............................................................................

/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_ctrlstru.cpp:15: FAILED:
  CHECK( trim(output) == trim(desiredOutput) )
with expansion:
  "_t1 = EUDExecuteOnce()
  if _t1():
      A = 1
  EUDEndExecuteOnce()"
  ==
  "if EUDExecuteOnce()():
      A = 1
  EUDEndExecuteOnce()"

[Error -2] Module "<test>" Line 1 : General syntax error
[Error 13494] Module "<test>" Line 1 : Chunk-level error
[Error 13494] Module "<test>" Line 1 : Chunk-level error
-------------------------------------------------------------------------------
Multiple variable
-------------------------------------------------------------------------------
/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_globalv.cpp:17
...............................................................................

/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_globalv.cpp:23: FAILED:
  CHECK( trim(ParseString("<test>", "var a, b = 1, 2;", false)) == trim("a, b = EUDCreateVariables(2)\n" "_IGVA([a, b], lambda: [1, 2])\n") )
with expansion:
  "a, b = _TYGV([None, None], lambda: [1, 2])"
  ==
  "a, b = EUDCreateVariables(2)
  _IGVA([a, b], lambda: [1, 2])"

[Error -2] Module "<test>" Line 1 : General syntax error
[Error -1] Module "<test>" Line 1 : Unrecoverable error
[Error -2] Module "<test>" Line 1 : General syntax error
[Error 13494] Module "<test>" Line 1 : Chunk-level error
-------------------------------------------------------------------------------
Debug info
  Statements
  Variable declaration
-------------------------------------------------------------------------------
/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_debuginfo.cpp:36
...............................................................................

/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_debuginfo.cpp:45: FAILED:
  CHECK( trim(output) == trim(desiredOutput) )
with expansion:
  "A = _TYSV([None], [1])"
  ==
  "A = EUDVariable(1)"

/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_debuginfo.cpp:52: FAILED:
  CHECK( trim(output) == trim(desiredOutput) )
with expansion:
  "EUDTraceLog(1)
  A = _TYLV([None], [1])"
  ==
  "EUDTraceLog(1)
  A = EUDVariable()
  A << (1)"

-------------------------------------------------------------------------------
Static variable
-------------------------------------------------------------------------------
/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_staticv.cpp:7
...............................................................................

/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_staticv.cpp:8: FAILED:
  CHECK( trim(output) == trim(desiredOutput) )
with expansion:
  "x = _TYSV([None], [0])"
  ==
  "x = EUDVariable(0)"

/Volumes/External/Programming/eudplib/src/epscript/test/parser/test_staticv.cpp:9: FAILED:
  CHECK( trim(output) == trim(desiredOutput) )
with expansion:
  "x, y = _TYSV([None, None], [0, 1])"
  ==
  "x, y = (EUDVariable(x) for x in (0, 1))"

[Error -2] Module "<test>" Line 4 : General syntax error
[Error 8510] Module "<test>" Line 4 : Incomplete statement. Check if the previous line have ended properly.
[Error -2] Module "<test>" Line 7 : General syntax error
[Error 8510] Module "<test>" Line 7 : Incomplete statement. Check if the previous line have ended properly.
[Error -2] Module "<test>" Line 8 : General syntax error
[Error 8510] Module "<test>" Line 8 : Incomplete statement. Check if the previous line have ended properly.
===============================================================================
test cases:  33 |  28 passed | 5 failed
assertions: 272 | 265 passed | 7 failed

After

[Error -2] Module "<test>" Line 1 : General syntax error
[Error 13494] Module "<test>" Line 1 : Chunk-level error
[Error 13494] Module "<test>" Line 1 : Chunk-level error
[Error -2] Module "<test>" Line 1 : General syntax error
[Error -1] Module "<test>" Line 1 : Unrecoverable error
[Error -2] Module "<test>" Line 1 : General syntax error
[Error 13494] Module "<test>" Line 1 : Chunk-level error
[Error -2] Module "<test>" Line 4 : General syntax error
[Error 8510] Module "<test>" Line 4 : Incomplete statement. Check if the previous line have ended properly.
[Error -2] Module "<test>" Line 7 : General syntax error
[Error 8510] Module "<test>" Line 7 : Incomplete statement. Check if the previous line have ended properly.
[Error -2] Module "<test>" Line 8 : General syntax error
[Error 8510] Module "<test>" Line 8 : Incomplete statement. Check if the previous line have ended properly.
===============================================================================
All tests passed (272 assertions in 33 test cases)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant