mirror of
https://github.com/cobalt-org/cobalt.rs
synced 2024-11-15 00:17:29 +00:00
tests: Changing syntax theme
This commit is contained in:
parent
043240c61a
commit
be782b5d13
4 changed files with 47 additions and 0 deletions
2
tests/fixtures/syntax_highlight_theme/.cobalt.yml
vendored
Normal file
2
tests/fixtures/syntax_highlight_theme/.cobalt.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
syntax-highlight:
|
||||
theme: Solarized (light)
|
23
tests/fixtures/syntax_highlight_theme/rust.md
vendored
Normal file
23
tests/fixtures/syntax_highlight_theme/rust.md
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
This is a rust markdown-inline-example
|
||||
|
||||
```rust
|
||||
|
||||
fn hello() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
{% highlight rust %}
|
||||
|
||||
pub struct World {
|
||||
virtual: bool
|
||||
}
|
||||
|
||||
fn create(virtual: bool) -> World {
|
||||
World{virtual: virtual}
|
||||
}
|
||||
|
||||
{% endhighlight %}
|
|
@ -146,7 +146,10 @@ pub fn custom_template_extensions() {
|
|||
#[cfg(feature = "syntax-highlight")]
|
||||
#[test]
|
||||
pub fn syntax_highlight() {
|
||||
// Syntect isn't thread safe, for now run everything in the same test.
|
||||
run_test("syntax_highlight").expect("Build error");
|
||||
|
||||
run_test("syntax_highlight_theme").expect("Build error");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
19
tests/target/syntax_highlight_theme/rust.html
Normal file
19
tests/target/syntax_highlight_theme/rust.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<p>This is a rust markdown-inline-example</p>
|
||||
<pre style="background-color:#fdf6e3">
|
||||
<span style="background-color:#fdf6e3;color:#657b83;">
|
||||
</span><span style="background-color:#fdf6e3;color:#268bd2;">fn</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#b58900;">hello</span><span style="background-color:#fdf6e3;color:#657b83;">(</span><span style="background-color:#fdf6e3;color:#657b83;">)</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#657b83;">-></span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#268bd2;">bool</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#657b83;">{</span><span style="background-color:#fdf6e3;color:#657b83;">
|
||||
</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#b58900;">true</span><span style="background-color:#fdf6e3;color:#657b83;">
|
||||
</span><span style="background-color:#fdf6e3;color:#657b83;">}</span><span style="background-color:#fdf6e3;color:#657b83;">
|
||||
</span><span style="background-color:#fdf6e3;color:#657b83;">
|
||||
</span></pre><pre style="background-color:#fdf6e3;">
|
||||
|
||||
|
||||
<span style="color:#859900;">pub</span><span style="color:#657b83;"> </span><span style="color:#268bd2;">struct</span><span style="color:#657b83;"> </span><span style="color:#657b83;">World</span><span style="color:#657b83;"> </span><span style="color:#657b83;">{</span>
|
||||
<span style="color:#657b83;"> </span><span style="color:#268bd2;">virtual</span><span style="color:#657b83;">:</span><span style="color:#657b83;"> </span><span style="color:#268bd2;">bool</span>
|
||||
<span style="color:#657b83;">}</span>
|
||||
|
||||
<span style="color:#268bd2;">fn</span><span style="color:#657b83;"> </span><span style="color:#b58900;">create</span><span style="color:#657b83;">(</span><span style="color:#268bd2;">virtual</span><span style="color:#657b83;">:</span><span style="color:#657b83;"> </span><span style="color:#268bd2;">bool</span><span style="color:#657b83;">)</span><span style="color:#657b83;"> </span><span style="color:#657b83;">-></span><span style="color:#657b83;"> World</span><span style="color:#657b83;"> </span><span style="color:#657b83;">{</span>
|
||||
<span style="color:#657b83;"> World</span><span style="color:#657b83;">{</span><span style="background-color:#ec9489;color:#657b83;">virtual</span><span style="color:#657b83;">:</span><span style="color:#657b83;"> </span><span style="background-color:#ec9489;color:#657b83;">virtual</span><span style="color:#657b83;">}</span>
|
||||
<span style="color:#657b83;">}</span>
|
||||
|
||||
</pre>
|
Loading…
Reference in a new issue