Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Fix UI tests (#51)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Flansburg <[email protected]>
  • Loading branch information
kflansburg authored Sep 27, 2021
1 parent 5511ecf commit d60f48d
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install toolchain stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
default: true
- name: UI Test with toolchain stable
uses: actions-rs/cargo@v1
Expand Down
5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion krator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tokio = { version = "1.0", features = ["fs", "macros", "signal", "rt-multi-threa
opentelemetry-jaeger = "0.11"
tracing-opentelemetry = "0.11"
structopt = "0.3"
compiletest_rs = "0.6"
compiletest_rs = { version = "0.7", git = "https://github.com/kflansburg/compiletest-rs.git" }

[[example]]
name = "moose"
Expand Down
1 change: 1 addition & 0 deletions krator/tests/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fn compile_test() {
let mut config = compiletest_rs::Config {
mode: compiletest_rs::common::Mode::Ui,
src_base: PathBuf::from("tests/ui"),
target_rustcflags: Some(" -Z ui-testing ".to_string()),
..Default::default()
};
link_deps(&mut config);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0451]: field `state` of struct `StateHolder` is private
--> $DIR/cannot_construct_transition_next.rs:26:9
|
26 | state: Box::new(Stub),
LL | state: Box::new(Stub),
| ^^^^^^^^^^^^^^^^^^^^^ private field

error: aborting due to previous error
Expand Down
10 changes: 8 additions & 2 deletions krator/tests/ui/state/next_must_be_state.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
error[E0277]: the trait bound `NotState: krator::State<PodState>` is not satisfied
--> $DIR/next_must_be_state.rs:39:9
|
39 | Transition::next(self, NotState)
LL | Transition::next(self, NotState)
| ^^^^^^^^^^^^^^^^ the trait `krator::State<PodState>` is not implemented for `NotState`
|
= note: required by `Transition::<S>::next`
note: required by `Transition::<S>::next`
--> $SRC_DIR/src/state.rs:43:5
|
LL | / pub fn next<I: State<S>, O: State<S>>(_i: Box<I>, o: O) -> Transition<S>
LL | | where
LL | | I: TransitionTo<O>,
| |___________________________^

error: aborting due to previous error

Expand Down
10 changes: 8 additions & 2 deletions krator/tests/ui/state/require_same_object_state.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
error[E0277]: the trait bound `OtherState: krator::State<PodState>` is not satisfied
--> $DIR/require_same_object_state.rs:50:9
|
50 | Transition::next(self, OtherState)
LL | Transition::next(self, OtherState)
| ^^^^^^^^^^^^^^^^ the trait `krator::State<PodState>` is not implemented for `OtherState`
|
= help: the following implementations were found:
<OtherState as krator::State<OtherPodState>>
= note: required by `Transition::<S>::next`
note: required by `Transition::<S>::next`
--> $SRC_DIR/src/state.rs:43:5
|
LL | / pub fn next<I: State<S>, O: State<S>>(_i: Box<I>, o: O) -> Transition<S>
LL | | where
LL | | I: TransitionTo<O>,
| |___________________________^

error: aborting due to previous error

Expand Down
10 changes: 8 additions & 2 deletions krator/tests/ui/state/require_transition_to.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
error[E0277]: the trait bound `TestState: TransitionTo<_>` is not satisfied
--> $DIR/require_transition_to.rs:38:9
|
38 | Transition::next(self, TestState)
LL | Transition::next(self, TestState)
| ^^^^^^^^^^^^^^^^ the trait `TransitionTo<_>` is not implemented for `TestState`
|
= note: required by `Transition::<S>::next`
note: required by `Transition::<S>::next`
--> $SRC_DIR/src/state.rs:43:5
|
LL | / pub fn next<I: State<S>, O: State<S>>(_i: Box<I>, o: O) -> Transition<S>
LL | | where
LL | | I: TransitionTo<O>,
| |___________________________^

error: aborting due to previous error

Expand Down

0 comments on commit d60f48d

Please sign in to comment.