-
-
Notifications
You must be signed in to change notification settings - Fork 154
Testing Improvements #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Testing Improvements #715
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.