NSString+ZZRegexTest.m 836 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // NSString+ZZRegex.m
  3. // ZZFoundation_Tests
  4. //
  5. // Created by Max on 2020/12/25.
  6. // Copyright © 2020 bymiracles@163.com. All rights reserved.
  7. //
  8. #import "Kiwi.h"
  9. #import <ZZFoundation.h>
  10. SPEC_BEGIN(StringRegex)
  11. NSString * chinese = @"你莫走";
  12. NSString * chineseCharacter = @"你好,李银河!";
  13. NSString * num = @"1232131321";
  14. NSString * characterNum = @"Zz1232131321";
  15. describe(@"Chinese regex", ^{
  16. it(@"chineseStr should be all Chinese", ^{
  17. [[theValue([chinese ZZCheckAllChinese]) should] beTrue];
  18. });
  19. it(@"chineseCharacterStr should not be all Chinese", ^{
  20. [[theValue([chineseCharacter ZZCheckAllChinese]) should] beFalse];
  21. });
  22. it(@"characterNum should not be all Chinese", ^{
  23. [[theValue([characterNum ZZCheckAllChinese]) should] beFalse];
  24. });
  25. });
  26. SPEC_END