Skip to content

Commit

Permalink
chore: Organize tests by chapter and add a test for calling `super.in…
Browse files Browse the repository at this point in the history
…it()` (#40)

🧹 Housekeeping
  • Loading branch information
danvk authored Feb 2, 2024
1 parent 91903cf commit fe1d2f4
Show file tree
Hide file tree
Showing 40 changed files with 16 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions baselines/chapter13/super-init.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Parent init
Child init
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions examples/chapter13/super-init.lox
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Parent {
init() {
print("Parent init");
}
}

class Child < Parent {
init() {
super.init();
print("Child init");
}
}

var c = Child();
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fe1d2f4

Please sign in to comment.