Skip to content

Commit 0c18fd0

Browse files
committed
Test code example in readme
1 parent c0fca97 commit 0c18fd0

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ ureq = { version = "2", optional = true }
4848
[dev-dependencies]
4949
async-std = { version = "1.9.0", features = ["attributes"] }
5050
backtrace = "0.3.60"
51+
doc-comment = "0.3.3"
5152
env_logger = "0.9.0"
5253
opentelemetry = { version = "0.16", features = ["rt-tokio"] }
5354
opentelemetry-application-insights = { path = ".", features = ["reqwest-client", "reqwest-blocking-client"] }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ An [Azure Application Insights](https://docs.microsoft.com/en-us/azure/azure-mon
1212

1313
Configure a OpenTelemetry pipeline using the Application Insights exporter and start creating spans (this example requires the **reqwest-client** feature):
1414

15-
```rust
15+
```rust,no_run
1616
use opentelemetry::trace::Tracer as _;
1717
1818
fn main() {

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ mod convert;
218218
#[cfg(feature = "metrics")]
219219
mod metrics;
220220
mod models;
221+
#[cfg(doctest)]
222+
mod readme_test;
221223
mod tags;
222224
mod trace;
223225
mod uploader;

src/readme_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
doc_comment::doctest!("../README.md");

0 commit comments

Comments
 (0)