8
0

regexp.js 740 B

123456789101112131415161718192021
  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. // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534)
  10. const testFn = () => ( new RegExp( '\\p{L}', 'u' ) ).test( 'ć' );
  11. if ( regExpFeatureDetection.isUnicodePropertySupported ) {
  12. expect( testFn() ).to.be.true;
  13. } else {
  14. expect( testFn ).to.throw();
  15. }
  16. } );
  17. } );
  18. } );