-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
- Loading branch information
1 parent
0b33481
commit 1f4623f
Showing
21 changed files
with
323 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
global component GlobalTest { | ||
fun render : Html { | ||
<div class="global-component"/> | ||
} | ||
} | ||
|
||
suite "Global Component" { | ||
test "It renders on the page" { | ||
Dom.getElementBySelector(".global-component") != Maybe.Nothing | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
suite "Test" { | ||
test "X" { | ||
true | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
import { testRunner as A } from "./runtime.js"; | ||
|
||
export default () => { | ||
new A([{ | ||
tests: [{ | ||
proc: () => { | ||
return true | ||
}, | ||
location: {"start":[2,2],"end":[4,3],"filename":"compilers/test"}, | ||
name: `X` | ||
}], | ||
location: {"start":[1,0],"end":[5,1],"filename":"compilers/test"}, | ||
name: `Test` | ||
}], {}, ``, ``) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
global component Modal { | ||
fun render : Html { | ||
<div>"Hello"</div> | ||
} | ||
} | ||
|
||
suite "Test" { | ||
test "X" { | ||
true | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
import { | ||
createElement as A, | ||
testRunner as B | ||
} from "./runtime.js"; | ||
|
||
export const C = () => { | ||
return A(`div`, {}, [`Hello`]) | ||
}; | ||
|
||
export default () => { | ||
new B([{ | ||
tests: [{ | ||
proc: () => { | ||
return true | ||
}, | ||
location: {"start":[8,2],"end":[10,3],"filename":"compilers/test_with_global_component"}, | ||
name: `X` | ||
}], | ||
location: {"start":[7,0],"end":[11,1],"filename":"compilers/test_with_global_component"}, | ||
name: `Test` | ||
}], { | ||
C: C | ||
}, ``, ``) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
type Maybe(a) { | ||
Nothing | ||
Just(a) | ||
} | ||
|
||
suite "Test" { | ||
test "X" { | ||
<button as button/> | ||
|
||
button == Maybe.Nothing | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
import { | ||
createElement as D, | ||
testRunner as B, | ||
createRef as C, | ||
compare as F, | ||
variant as A, | ||
setRef as E | ||
} from "./runtime.js"; | ||
|
||
export const | ||
G = A(0, `Maybe.Nothing`), | ||
H = A(1, `Maybe.Just`); | ||
|
||
export default () => { | ||
new B([{ | ||
tests: [{ | ||
proc: () => { | ||
const a = C(new G()); | ||
return (() => { | ||
D(`button`, { | ||
ref: E(a, H) | ||
}); | ||
return F(a.current, new G()) | ||
})() | ||
}, | ||
location: {"start":[7,2],"end":[11,3],"filename":"compilers/test_with_reference"}, | ||
name: `X` | ||
}], | ||
location: {"start":[6,0],"end":[12,1],"filename":"compilers/test_with_reference"}, | ||
name: `Test` | ||
}], {}, ``, ``) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
type Maybe(a) { | ||
Nothing | ||
Just(a) | ||
} | ||
|
||
component Button { | ||
fun render : Html { | ||
<div/> | ||
} | ||
} | ||
|
||
suite "Test" { | ||
test "X" { | ||
<Button as button/> | ||
|
||
button == Maybe.Nothing | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
import { | ||
createElement as C, | ||
testRunner as D, | ||
createRef as E, | ||
compare as G, | ||
useMemo as B, | ||
variant as A, | ||
setRef as F | ||
} from "./runtime.js"; | ||
|
||
export const | ||
H = A(0, `Maybe.Nothing`), | ||
I = A(1, `Maybe.Just`), | ||
J = ({ | ||
_ | ||
}) => { | ||
const a = B(() => { | ||
return {} | ||
}, []); | ||
(_ ? _(a) : null); | ||
return C(`div`, {}) | ||
}; | ||
|
||
export default () => { | ||
new D([{ | ||
tests: [{ | ||
proc: () => { | ||
const b = E(new H()); | ||
return (() => { | ||
C(J, { | ||
_: F(b, I) | ||
}); | ||
return G(b.current, new H()) | ||
})() | ||
}, | ||
location: {"start":[13,2],"end":[17,3],"filename":"compilers/test_with_reference_component"}, | ||
name: `X` | ||
}], | ||
location: {"start":[12,0],"end":[18,1],"filename":"compilers/test_with_reference_component"}, | ||
name: `Test` | ||
}], {}, ``, ``) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.