Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Project/Sources/Classes/User.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
property id : Text
property name : Text
property email : Text

Class constructor($id : Text; $name : Text; $email : Text)
This.id := $id
This.name := $name
This.email := $email

Function toString() : Text
return This.name + " <" + This.email + ">"
10 changes: 10 additions & 0 deletions Project/Sources/Classes/UserTests.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var $user : cs.User

Check failure on line 1 in Project/Sources/Classes/UserTests.4dm

View workflow job for this annotation

GitHub Actions / Build on macOS

Class code out of any function

Check failure on line 1 in Project/Sources/Classes/UserTests.4dm

View workflow job for this annotation

GitHub Actions / Build on Windows

Class code out of any function

Check failure on line 1 in Project/Sources/Classes/UserTests.4dm

View workflow job for this annotation

GitHub Actions / Build on ubuntu-24.04

Class code out of any function

Check failure on line 1 in Project/Sources/Classes/UserTests.4dm

View workflow job for this annotation

GitHub Actions / Build on macOS

Class code out of any function

Check failure on line 1 in Project/Sources/Classes/UserTests.4dm

View workflow job for this annotation

GitHub Actions / Build on Windows

Class code out of any function

Check failure on line 1 in Project/Sources/Classes/UserTests.4dm

View workflow job for this annotation

GitHub Actions / Build on ubuntu-24.04

Class code out of any function

// Test constructor
$user:=cs.User.new("1"; "John Doe"; "[email protected]")
ASSERT($user.id="1")
ASSERT($user.name="John Doe")
ASSERT($user.email="[email protected]")

// Test toString method
ASSERT($user.toString()="John Doe <[email protected]>")
Loading