regexp.js 644 B

1234567891011121314151617181920
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. import regExpFeatureDetection from '../../src/featuredetection/regexp';
  6. describe( 'featuredetection', () => {
  7. describe( 'isUnicodePropertySupported', () => {
  8. it( 'should detect accessibility of unicode properties', () => {
  9. const testFn = () => ( new RegExp( '\\p{L}', 'u' ) ).test( 'ć' );
  10. if ( regExpFeatureDetection.isUnicodePropertySupported ) {
  11. expect( testFn() ).to.be.true;
  12. } else {
  13. expect( testFn ).to.throw();
  14. }
  15. } );
  16. } );
  17. } );