mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-13 08:05:01 +00:00
refactor: move language examples to fixture files
This commit is contained in:
parent
565f08a8e9
commit
4de8c25a3f
5 changed files with 148 additions and 144 deletions
38
tests/fixtures/languages/elm/test.elm
vendored
Normal file
38
tests/fixtures/languages/elm/test.elm
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
module Main exposing (main, Person, Greeting)
|
||||
|
||||
import Html exposing (Html, div, text)
|
||||
import Html.Attributes exposing (class)
|
||||
|
||||
type alias Person =
|
||||
{ name : String
|
||||
, age : Int
|
||||
}
|
||||
|
||||
type Greeting
|
||||
= Formal
|
||||
| Casual
|
||||
|
||||
greet : Greeting -> Person -> String
|
||||
greet style person =
|
||||
let
|
||||
prefix =
|
||||
case style of
|
||||
Formal ->
|
||||
"Good day"
|
||||
|
||||
Casual ->
|
||||
"Hi"
|
||||
in
|
||||
prefix ++ ", " ++ person.name ++ "!"
|
||||
|
||||
defaultPerson : Person
|
||||
defaultPerson =
|
||||
{ name = "World"
|
||||
, age = 42
|
||||
}
|
||||
|
||||
main : Html msg
|
||||
main =
|
||||
div [ class "greeting" ]
|
||||
[ text (greet Formal defaultPerson)
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue