未验证 提交 cb615a2c 编辑于 作者: red's avatar red 提交者: GitHub
浏览文件

Merge pull request #1 from 996icu/master

merge
Copyright © 2019 <copyright holders>
The 996ICU License (996ICU)
996ICU License is an extented license for {other}.
This license extended {other}, and {other} will be declared at the foot of this license.
Individual who seeks authorization must fulfill the following obligations:
1. Including this authorization file in any of its copies and important parts of the software.
Organization that seeks authorization must fulfill the following obligations:
1. Including this authorization file in any of its copies and important parts of the software.
2. Not forcing any employee or temporary worker to work in excess of the legal maximum working time in any form or by any means, including but not limited to: orders, threats, implications, etc.
3. Not retaliating against any employee or temporary worker without participating in labor in excess of the legal maximum working time in any form or by any means, including but not limited to: mental assaults, personal injuries, illegal deductions of due remuneration, illegal dismissals, etc.
4. Paying economic compensation at no lower than the standards stipulated by local laws and regulations, when organizing employees or temporary workers to work overtime.
5. This organization is not in the blacklist[^1] as stipulated in the agreement.
If the authorized individual or organization fails to fulfill any of the above obligations, the authorization will be withdrawn.
The undefined behavior of this license is handled by {other}. The part of {other} that conflicts with this agreement is handled in accordance with this agreement.
* Discussion https://github.com/996icu/996.ICU/pull/15642
* 996 from https://feathub.com/LinXueyuanStdio/996.ICU
* [^1]: blacklist https://github.com/996icu/996.ICU/blob/master/blacklist/blacklist.md
{other}
--------------------------------------------------------------------------------
{content}
Copyright © 2019 <copyright holders>
The 996ICU License (996ICU)
996ICU License 是一个关于 {other} 的扩展协议.
此协议扩展了 {other}, {other} 将在本协议文本末尾声明.
要求得到授权的个人履行以下义务:
1. 将此授权文件包含在其任何副本以及软件的重要部分中.
要求得到授权的组织履行以下义务:
1. 将此授权文件包含在其任何副本以及软件的重要部分中.
2. 不以任何形式或手段强迫其雇佣员工或临时劳动者进行超过当地法定最长劳动时间的劳动,
包括但不限于: 命令, 威胁, 暗示等.
3. 不以任何形式报复不参与超过法定最长劳动时间的劳动的雇佣员工或临时劳动者,
包括但不限于: 辱骂等精神攻击, 殴打等人身伤害以及非法开除等.
4. 组织其雇佣员工或临时劳动者进行超时劳动时,按不低于当地法规标准支付经济补偿.
5. 此组织不在协议规定的黑名单中.
如果获得授权的个人或组织未能履行以上义务任意一条, 则授权将被收回.
此协议未定义的行为, 按 {other} 协议处理.
{other} 与本协议冲突的部分, 按本协议处理.
https://github.com/996icu/996.ICU/pull/15642
996 from https://feathub.com/LinXueyuanStdio/996.ICU
黑名单: https://github.com/996icu/996.ICU/blob/master/blacklist/blacklist.md
{other}
--------------------------------------------------------------------------------
{content}
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org>
// Copyright © 2019 Andy Pan <panjf2000@gmail.com>
//
// 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.
// The source repository URL: https://github.com/panjf2000/gen-license-go
package main
import "github.com/panjf2000/gen-license-go/cmd"
func main() {
cmd.Execute()
}
......@@ -2,7 +2,7 @@
Generate LICENSES. Use Python3.
All LICENSE file comes from github. to see the license code [here](https://help.github.com/en/articles/licensing-a-repository#searching-github-by-license-type)
All LICENSE file comes from github. [Click here](https://help.github.com/en/articles/licensing-a-repository#searching-github-by-license-type) to see the license code.
Support [996.ICU Expanded LICENSE](https://github.com/996icu/996.ICU)
......
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "assert_cmd"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"escargot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"predicates 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cfg-if"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "difference"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "dir-diff"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "escargot"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "itoa"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazy_static"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "log"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "predicates"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "predicates-core"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "predicates-tree"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "proc-macro2"
version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quote"
version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_core"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rdrand"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "remove_dir_all"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ryu"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "same-file"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde"
version = "1.0.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_derive"
version = "1.0.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_json"
version = "1.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "syn"
version = "0.15.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tempdir"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "test-gen-license"
version = "0.1.0"
dependencies = [
"assert_cmd 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
"dir-diff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "treeline"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "walkdir"
version = "2.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-util"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum assert_cmd 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2dc477793bd82ec39799b6f6b3df64938532fdf2ab0d49ef817eac65856a5a1e"
"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4"
"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
"checksum dir-diff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1cce6e50ca36311e494793f7629014dc78cd963ba85cd05968ae06a63b867f0b"
"checksum escargot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ceb9adbf9874d5d028b5e4c5739d22b71988252b25c9c98fe7cf9738bee84597"
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
"checksum libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)" = "bedcc7a809076656486ffe045abeeac163da1b558e963a31e29fbfbeba916917"
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
"checksum predicates 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa984b7cd021a0bf5315bcce4c4ae61d2a535db2a8d288fc7578638690a7b7c3"
"checksum predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178"
"checksum predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124"
"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915"
"checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1"
"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
"checksum serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "aa5f7c20820475babd2c077c3ab5f8c77a31c15e16ea38687b4c02d3e48680f4"
"checksum serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "58fc82bec244f168b23d1963b45c8bf5726e9a15a9d146a067f9081aeed2de79"
"checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d"
"checksum syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)" = "66c8865bf5a7cbb662d8b011950060b3c8743dca141b054bf7195b20d314d8e2"
"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
"checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[package]
name = "test-gen-license"
version = "0.1.0"
authors = ["VitalyR <vitalyankh@gmail.com>"]
edition = "2018"
[dependencies]
assert_cmd = "0.11.1"
dir-diff = "0.3.1"
tempdir = "0.3.7"
# Test for license generator tools
## The purpose
The 999.ICU project has many(now, the number is 3) license generator tools and it seems that the number of that will continue to grow. Thus I write this test tool to validate the functionality of the tools.
I hope the newly added tools must add a test file and pass the tests.
## Usage
For example, if you would like to add a license generator tool written by `ruby`, you just need to copy the `test_go.rs` file and rename it as `test_ruby.rs`, and replace the parameter in `arg()` of the test function.
\ No newline at end of file
pub mod test_go;
pub mod test_py;
pub mod test_rust;
use assert_cmd::prelude::*;
use dir_diff;
use std::process::Command;
use tempdir;
use tempdir::TempDir;
#[test]
fn test_rust_help() {
/// todo: compile rust executive file
let path = "cargo";
let mut cmd = Command::new("run");
/// todo: add directory
cmd.dir("");
// assert_eq!(output, help);
let assert = cmd.assert();
assert.success().stdout(
r#"gen-license-go is a 996.icu license generator implemented in Go,
this generator is developed to generate various open-source licenses including MIT, Apache, etc.
More importantly, the main purpose of this tool is to incorporate those aforesaid licenses into
a brand new license: 996.icu, defined by this repository.
Usage:
gen-license-go [flags]
gen-license-go [command]
Available Commands:
gen gen is a 996.icu license generator-command.
help Help about any command
Flags:
-h, --help help for gen-license-go
-l, --list list all licenses (default true)
Use "gen-license-go [command] --help" for more information about a command."#,
);
}
use assert_cmd::prelude::*;
use dir_diff;
use std::process::Command;
use tempdir;
use tempdir::TempDir;
#[test]
fn test_go_help() {
let path = if cfg!(targe_os = "windows") {
"../gen-license-go/bin/windows/gen-license-go.exe"
} else if cfg!(target_os = "linux") {
"../gen-license-go/bin/linux/gen-license-go"
} else {
"../gen-license-go/bin/osx/gen-license-go"
};
let mut cmd = Command::new(&path);
cmd.arg("-h");
// assert_eq!(output, help);
let assert = cmd.assert();
assert.success().stdout(
r#"gen-license-go is a 996.icu license generator implemented in Go,
this generator is developed to generate various open-source licenses including MIT, Apache, etc.
More importantly, the main purpose of this tool is to incorporate those aforesaid licenses into
a brand new license: 996.icu, defined by this repository.
Usage:
gen-license-go [flags]
gen-license-go [command]
Available Commands:
gen gen is a 996.icu license generator-command.
help Help about any command
Flags:
-h, --help help for gen-license-go
-l, --list list all licenses (default true)
Use "gen-license-go [command] --help" for more information about a command."#,
);
}
#[test]
fn test_go_create_license_mit() {
let tmp_dir = TempDir::new("foo").expect("create temp dir failed");
let path = if cfg!(targe_os = "windows") {
"../gen-license-go/bin/windows/gen-license-go.exe"
} else if cfg!(target_os = "linux") {
"../gen-license-go/bin/linux/gen-license-go"
} else {
"../gen-license-go/bin/osx/gen-license-go"
};
let mut cmd = Command::new(&path);
cmd.arg("gen").arg("mit").arg("--996icu").args("en-us");
assert!(
!dir_diff::is_different(&tmp_dir.path(), "../../gen-license-go/licenses/mit.txt").unwrap()
);
}
#[test]
fn test_go_create_license_996icu() {
let tmp_dir = TempDir::new("foo").expect("create temp dir failed");
let path = if cfg!(targe_os = "windows") {
"../gen-license-go/bin/windows/gen-license-go.exe"
} else if cfg!(target_os = "linux") {
"../gen-license-go/bin/linux/gen-license-go"
} else {
"../gen-license-go/bin/osx/gen-license-go"
};
let mut cmd = Command::new(&path);
cmd.arg("gen").arg("--996icu").arg("--996icu").args("en-us");
assert!(!dir_diff::is_different(
&tmp_dir.path(),
"../../gen-license-go/licenses/996.icu.template.en-us.txt"
)
.unwrap());
}
#[test]
fn test_go_create_license_agpl() {
let tmp_dir = TempDir::new("foo").expect("create temp dir failed");
let path = if cfg!(targe_os = "windows") {
"../gen-license-go/bin/windows/gen-license-go.exe"
} else if cfg!(target_os = "linux") {
"../gen-license-go/bin/linux/gen-license-go"
} else {
"../gen-license-go/bin/osx/gen-license-go"
};
let mut cmd = Command::new(&path);
cmd.arg("gen")
.arg("--agpl-3.0")
.arg("--996icu")
.args("en-us");
assert!(!dir_diff::is_different(
&tmp_dir.path(),
"../../gen-license-go/licenses/agpl-3.0.txt"
)
.unwrap());
}
#[test]
fn test_go_create_license_apache() {
let tmp_dir = TempDir::new("foo").expect("create temp dir failed");
let path = if cfg!(targe_os = "windows") {
"../gen-license-go