Skip to content

Commit

Permalink
#26: --eoc works
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 5, 2022
1 parent e74609c commit ffd32aa
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
39 changes: 39 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ hex = "0.4.3"

[dev-dependencies]
assert_cmd = "2.0.4"
fsutils = "0.1.7"
rstest = "0.15.0"
tempfile = "3.3.0"
predicates = "2.1.1"
Expand Down
32 changes: 31 additions & 1 deletion tests/reo_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use anyhow::Result;
use anyhow::{Context, Result};
use glob::glob;
use predicates::prelude::predicate;
use predicates::prelude::*;
Expand Down Expand Up @@ -67,6 +67,36 @@ fn dataizes_simple_gmi() -> Result<()> {
Ok(())
}

#[test]
fn dataizes_in_eoc_mode() -> Result<()> {
let tmp = TempDir::new()?;
let dir = tmp
.path()
.join(".eoc")
.join("gmi");
fsutils::mkdir(
dir.to_str()
.context(format!("Broken path {}", dir.display()))?,
);
File::create(dir.join("foo.gmi"))?.write_all(
"
ADD('$ν1');
BIND('$ε1', 'ν0', '$ν1', 'foo');
DATA('$ν1', 'ff ff');
".as_bytes()
)?;
assert_cmd::Command::cargo_bin("reo")
.unwrap()
.current_dir(tmp.path())
.arg("--eoc")
.arg("dataize")
.arg("foo")
.assert()
.success()
.stdout("ff-ff\n");
Ok(())
}

#[test]
fn dataizes_all_gmi_tests() -> Result<()> {
for f in glob("gmi-tests/*.gmi")? {
Expand Down

0 comments on commit ffd32aa

Please sign in to comment.