Skip to content

Commit

Permalink
feat: Add: 1.omiga module.
Browse files Browse the repository at this point in the history
Signed-off-by: photowey <[email protected]>
  • Loading branch information
photowey committed Jul 10, 2024
1 parent ed9f413 commit d75a473
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"crates/env",
"crates/macroattr",
"crates/macrofn",
"crates/omiga",
"crates/tester",
"crates/testing",
"crates/tests",
Expand Down
6 changes: 6 additions & 0 deletions crates/omiga/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "omiga"
version = "0.1.0"
edition = "2021"

[dependencies]
28 changes: 28 additions & 0 deletions crates/omiga/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright © 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// lib

// ----------------------------------------------------------------

#[cfg(test)]
mod tests;

// ----------------------------------------------------------------

fn add(left: i32, right: i32) -> i32 {
left + right
}
28 changes: 28 additions & 0 deletions crates/omiga/src/tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright © 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// tests

// ----------------------------------------------------------------

use crate::add;

// ----------------------------------------------------------------

#[test]
fn test_add() {
assert_eq!(add(1, 2), 3);
}

0 comments on commit d75a473

Please sign in to comment.