summaryrefslogtreecommitdiff
path: root/tests/snapshots
diff options
context:
space:
mode:
Diffstat (limited to 'tests/snapshots')
-rw-r--r--tests/snapshots/term__empty__rich_ascii_no_color.snap17
-rw-r--r--tests/snapshots/term__empty_ranges__rich_ascii_no_color.snap29
-rw-r--r--tests/snapshots/term__fizz_buzz__rich_ascii_no_color.snap42
-rw-r--r--tests/snapshots/term__message__rich_ascii_no_color.snap13
-rw-r--r--tests/snapshots/term__message_and_notes__rich_ascii_no_color.snap17
-rw-r--r--tests/snapshots/term__message_errorcode__rich_ascii_no_color.snap21
-rw-r--r--tests/snapshots/term__multifile__rich_ascii_no_color.snap35
-rw-r--r--tests/snapshots/term__multiline_overlapping__rich_ascii_no_color.snap25
-rw-r--r--tests/snapshots/term__overlapping__rich_ascii_no_color.snap58
-rw-r--r--tests/snapshots/term__position_indicator__rich_ascii_no_color.snap14
-rw-r--r--tests/snapshots/term__same_line__rich_ascii_no_color.snap17
-rw-r--r--tests/snapshots/term__same_ranges__rich_ascii_no_color.snap14
12 files changed, 302 insertions, 0 deletions
diff --git a/tests/snapshots/term__empty__rich_ascii_no_color.snap b/tests/snapshots/term__empty__rich_ascii_no_color.snap
new file mode 100644
index 0000000..1ec1a94
--- /dev/null
+++ b/tests/snapshots/term__empty__rich_ascii_no_color.snap
@@ -0,0 +1,17 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+bug:
+
+error:
+
+warning:
+
+note:
+
+help:
+
+bug:
+
+
diff --git a/tests/snapshots/term__empty_ranges__rich_ascii_no_color.snap b/tests/snapshots/term__empty_ranges__rich_ascii_no_color.snap
new file mode 100644
index 0000000..bbf44fb
--- /dev/null
+++ b/tests/snapshots/term__empty_ranges__rich_ascii_no_color.snap
@@ -0,0 +1,29 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+note: middle
+ --> hello:1:7
+ |
+1 | Hello world!
+ | ^ middle
+
+note: end of line
+ --> hello:1:13
+ |
+1 | Hello world!
+ | ^ end of line
+
+note: end of line
+ --> hello:2:11
+ |
+2 | Bye world!
+ | ^ end of line
+
+note: end of file
+ --> hello:3:4
+ |
+3 |
+ | ^ end of file
+
+
diff --git a/tests/snapshots/term__fizz_buzz__rich_ascii_no_color.snap b/tests/snapshots/term__fizz_buzz__rich_ascii_no_color.snap
new file mode 100644
index 0000000..55cb453
--- /dev/null
+++ b/tests/snapshots/term__fizz_buzz__rich_ascii_no_color.snap
@@ -0,0 +1,42 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0308]: `case` clauses have incompatible types
+ --> FizzBuzz.fun:8:12
+ |
+3 | fizz₁ : Nat → String
+ | ------ expected type `String` found here
+4 | fizz₁ num = case (mod num 5) (mod num 3) of
+ | /-------------'
+5 | | 0 0 => "FizzBuzz"
+6 | | 0 _ => "Fizz"
+7 | | _ 0 => "Buzz"
+8 | | _ _ => num
+ | | ^^^ expected `String`, found `Nat`
+ | \--------------' `case` clauses have incompatible types
+ |
+ = expected type `String`
+ found type `Nat`
+
+error[E0308]: `case` clauses have incompatible types
+ --> FizzBuzz.fun:16:16
+ |
+10 | fizz₂ : Nat → String
+ | ------ expected type `String` found here
+11 | fizz₂ num =
+12 | / case (mod num 5) (mod num 3) of
+13 | | 0 0 => "FizzBuzz"
+ | | ---------- this is found to be of type `String`
+14 | | 0 _ => "Fizz"
+ | | ------ this is found to be of type `String`
+15 | | _ 0 => "Buzz"
+ | | ------ this is found to be of type `String`
+16 | | _ _ => num
+ | | ^^^ expected `String`, found `Nat`
+ | \------------------' `case` clauses have incompatible types
+ |
+ = expected type `String`
+ found type `Nat`
+
+
diff --git a/tests/snapshots/term__message__rich_ascii_no_color.snap b/tests/snapshots/term__message__rich_ascii_no_color.snap
new file mode 100644
index 0000000..d3abe84
--- /dev/null
+++ b/tests/snapshots/term__message__rich_ascii_no_color.snap
@@ -0,0 +1,13 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error: a message
+
+warning: a message
+
+note: a message
+
+help: a message
+
+
diff --git a/tests/snapshots/term__message_and_notes__rich_ascii_no_color.snap b/tests/snapshots/term__message_and_notes__rich_ascii_no_color.snap
new file mode 100644
index 0000000..d4e209b
--- /dev/null
+++ b/tests/snapshots/term__message_and_notes__rich_ascii_no_color.snap
@@ -0,0 +1,17 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error: a message
+ = a note
+
+warning: a message
+ = a note
+
+note: a message
+ = a note
+
+help: a message
+ = a note
+
+
diff --git a/tests/snapshots/term__message_errorcode__rich_ascii_no_color.snap b/tests/snapshots/term__message_errorcode__rich_ascii_no_color.snap
new file mode 100644
index 0000000..e82fb7c
--- /dev/null
+++ b/tests/snapshots/term__message_errorcode__rich_ascii_no_color.snap
@@ -0,0 +1,21 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0001]: a message
+
+warning[W001]: a message
+
+note[N0815]: a message
+
+help[H4711]: a message
+
+error: where did my errorcode go?
+
+warning: where did my errorcode go?
+
+note: where did my errorcode go?
+
+help: where did my errorcode go?
+
+
diff --git a/tests/snapshots/term__multifile__rich_ascii_no_color.snap b/tests/snapshots/term__multifile__rich_ascii_no_color.snap
new file mode 100644
index 0000000..e162ed2
--- /dev/null
+++ b/tests/snapshots/term__multifile__rich_ascii_no_color.snap
@@ -0,0 +1,35 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error: unknown builtin: `NATRAL`
+ --> Data/Nat.fun:7:13
+ |
+7 | {-# BUILTIN NATRAL Nat #-}
+ | ^^^^^^ unknown builtin
+ |
+ = there is a builtin with a similar name: `NATURAL`
+
+warning: unused parameter pattern: `n₂`
+ --> Data/Nat.fun:17:16
+ |
+17 | zero - succ n₂ = zero
+ | ^^ unused parameter
+ |
+ = consider using a wildcard pattern: `_`
+
+error[E0001]: unexpected type in application of `_+_`
+ --> Test.fun:4:11
+ |
+ 4 | _ = 123 + "hello"
+ | ^^^^^^^ expected `Nat`, found `String`
+ |
+ --> Data/Nat.fun:11:1
+ |
+11 | _+_ : Nat → Nat → Nat
+ | --------------------- based on the definition of `_+_`
+ |
+ = expected type `Nat`
+ found type `String`
+
+
diff --git a/tests/snapshots/term__multiline_overlapping__rich_ascii_no_color.snap b/tests/snapshots/term__multiline_overlapping__rich_ascii_no_color.snap
new file mode 100644
index 0000000..3623d4d
--- /dev/null
+++ b/tests/snapshots/term__multiline_overlapping__rich_ascii_no_color.snap
@@ -0,0 +1,25 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0308]: match arms have incompatible types
+ --> codespan/src/file.rs:4:34
+ |
+1 | / match line_index.compare(self.last_line_index()) {
+2 | | Ordering::Less => Ok(self.line_starts()[line_index.to_usize()]),
+ | | --------------------------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
+3 | | Ordering::Equal => Ok(self.source_span().end()),
+ | | ---------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
+4 | | Ordering::Greater => LineIndexOutOfBoundsError {
+ | /-|----------------------------------^
+5 | | | given: line_index,
+6 | | | max: self.last_line_index(),
+7 | | | },
+ | \-|-------------^ expected enum `Result`, found struct `LineIndexOutOfBoundsError`
+8 | | }
+ | \---------' `match` arms have incompatible types
+ |
+ = expected type `Result<ByteIndex, LineIndexOutOfBoundsError>`
+ found type `LineIndexOutOfBoundsError`
+
+
diff --git a/tests/snapshots/term__overlapping__rich_ascii_no_color.snap b/tests/snapshots/term__overlapping__rich_ascii_no_color.snap
new file mode 100644
index 0000000..b6002fc
--- /dev/null
+++ b/tests/snapshots/term__overlapping__rich_ascii_no_color.snap
@@ -0,0 +1,58 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0666]: nested `impl Trait` is not allowed
+ --> nested_impl_trait.rs:5:56
+ |
+5 | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
+ | ----------^^^^^^^^^^-
+ | | |
+ | | nested `impl Trait` here
+ | outer `impl Trait`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+ --> typeck_type_placeholder_item.rs:1:18
+ |
+1 | fn fn_test1() -> _ { 5 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+ --> typeck_type_placeholder_item.rs:2:25
+ |
+2 | fn fn_test2(x: i32) -> (_, _) { (x, x) }
+ | -^--^-
+ | || |
+ | || not allowed in type signatures
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
+ --> no_send_res_ports.rs:25:5
+ |
+25 | thread::spawn(move|| {
+ | ^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
+ | /-------------------'
+26 | | let y = x;
+27 | | println!("{:?}", y);
+28 | | });
+ | \------' within this `[closure@no_send_res_ports.rs:29:19: 33:6 x:main::Foo]`
+ |
+ --> libstd/thread/mod.rs:5:8
+ |
+ 5 | F: Send + 'static,
+ | ---- required by this bound in `std::thread::spawn`
+ |
+ = help: within `[closure@no_send_res_ports.rs:29:19: 33:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
+ = note: required because it appears within the type `Port<()>`
+ = note: required because it appears within the type `main::Foo`
+ = note: required because it appears within the type `[closure@no_send_res_ports.rs:29:19: 33:6 x:main::Foo]`
+
+error: aborting due 5 previous errors
+ = Some errors have detailed explanations: E0121, E0277, E0666.
+ = For more information about an error, try `rustc --explain E0121`.
+
+
diff --git a/tests/snapshots/term__position_indicator__rich_ascii_no_color.snap b/tests/snapshots/term__position_indicator__rich_ascii_no_color.snap
new file mode 100644
index 0000000..d99ad14
--- /dev/null
+++ b/tests/snapshots/term__position_indicator__rich_ascii_no_color.snap
@@ -0,0 +1,14 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+warning[ParserWarning]: The strict mode declaration in the body of function `foo` is redundant, as the outer scope is already in strict mode
+ --> tests/main.js:4:3
+ |
+1 | "use strict";
+ | ------------ Strict mode is first declared here
+ .
+4 | "use strict";
+ | ^^^^^^^^^^^^ This strict mode declaration is redundant
+
+
diff --git a/tests/snapshots/term__same_line__rich_ascii_no_color.snap b/tests/snapshots/term__same_line__rich_ascii_no_color.snap
new file mode 100644
index 0000000..60e7afb
--- /dev/null
+++ b/tests/snapshots/term__same_line__rich_ascii_no_color.snap
@@ -0,0 +1,17 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0499]: cannot borrow `v` as mutable more than once at a time
+ --> one_line.rs:3:12
+ |
+3 | v.push(v.pop().unwrap());
+ | - ---- ^ second mutable borrow occurs here
+ | | |
+ | | first mutable borrow occurs here
+ | first borrow later used by call
+
+error: aborting due to previous error
+ = For more information about this error, try `rustc --explain E0499`.
+
+
diff --git a/tests/snapshots/term__same_ranges__rich_ascii_no_color.snap b/tests/snapshots/term__same_ranges__rich_ascii_no_color.snap
new file mode 100644
index 0000000..d64f099
--- /dev/null
+++ b/tests/snapshots/term__same_ranges__rich_ascii_no_color.snap
@@ -0,0 +1,14 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error: Unexpected token
+ --> same_range:1:5
+ |
+1 | ::S { }
+ | ^
+ | |
+ | Unexpected '{'
+ | Expected '('
+
+