File: test-var.rs

package info (click to toggle)
rust-dotenv 0.15.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 196 kB
  • sloc: makefile: 15
file content (17 lines) | stat: -rw-r--r-- 299 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mod common;

use std::env;

use dotenv::*;

use crate::common::*;

#[test]
fn test_var() {
    let dir = make_test_dotenv().unwrap();

    assert_eq!(var("TESTKEY").unwrap(), "test_val");

    env::set_current_dir(dir.path().parent().unwrap()).unwrap();
    dir.close().unwrap();
}