diff --git a/Makefile b/Makefile index 2bebc2e..5f2afe4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ .PHONY: test clean update doc serve-book test: plugins cd utils && $(MAKE) test - cd book && $(MAKE) test clean: cd bins && $(MAKE) clean cd utils && $(MAKE) clean diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4775d9f..00896d3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -68,5 +68,8 @@ jobs: - pwsh: make plugins displayName: "Build plugins" + - pwsh: make test + displayName: "Test" + - pwsh: make release-cross TARGET=$(target) displayName: "Build all" diff --git a/book/Makefile b/book/Makefile index 7dcae90..e8cd613 100644 --- a/book/Makefile +++ b/book/Makefile @@ -3,7 +3,5 @@ build: mdbook build serve: mdbook serve --open -test: - mdbook test clean: mdbook clean diff --git a/utils/gal-locale/src/lib.rs b/utils/gal-locale/src/lib.rs index 9ff87e4..27f1d86 100644 --- a/utils/gal-locale/src/lib.rs +++ b/utils/gal-locale/src/lib.rs @@ -103,13 +103,25 @@ mod test { #[test] fn accept() { - let current = "zh-CN".parse::().unwrap(); let accepts = [ "en".parse::().unwrap(), "ja".parse().unwrap(), "zh-Hans".parse().unwrap(), "zh-Hant".parse().unwrap(), ]; - assert_eq!(current.choose_from(accepts).unwrap().to_string(), "zh-Hans"); + assert_eq!( + "zh_CN" + .parse::() + .unwrap() + .choose_from(accepts.clone()), + Some("zh_Hans".parse::().unwrap()) + ); + assert_eq!( + "zh_TW" + .parse::() + .unwrap() + .choose_from(accepts.clone()), + Some("zh_Hant".parse::().unwrap()) + ); } }