mirror of
https://github.com/MorizzG/rlox.git
synced 2026-02-04 11:54:48 +00:00
added tests
This commit is contained in:
parent
1cca1494a4
commit
660464638f
255 changed files with 7220 additions and 3 deletions
22
interpreter/tests/lox/super/reassign_superclass.lox
Normal file
22
interpreter/tests/lox/super/reassign_superclass.lox
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
class Base {
|
||||
method() {
|
||||
print "Base.method()";
|
||||
}
|
||||
}
|
||||
|
||||
class Derived < Base {
|
||||
method() {
|
||||
super.method();
|
||||
}
|
||||
}
|
||||
|
||||
class OtherBase {
|
||||
method() {
|
||||
print "OtherBase.method()";
|
||||
}
|
||||
}
|
||||
|
||||
var derived = Derived();
|
||||
derived.method(); // expect: Base.method()
|
||||
Base = OtherBase;
|
||||
derived.method(); // expect: Base.method()
|
||||
Loading…
Add table
Add a link
Reference in a new issue