highlight.js 716 B

12345678910111213141516171819
  1. 'use strict';
  2. let hljs = require('../../build');
  3. let should = require('should');
  4. describe('.highlight()', function() {
  5. it('should works without continuation', function() {
  6. const code = "public void moveTo(int x, int y, int z);";
  7. const result = hljs.highlight('java', code, false, false);
  8. result.value.should.equal(
  9. '<span class="hljs-function"><span class="hljs-keyword">public</span> ' +
  10. '<span class="hljs-keyword">void</span> <span class="hljs-title">moveTo</span>' +
  11. '<span class="hljs-params">(<span class="hljs-keyword">int</span> x, ' +
  12. '<span class="hljs-keyword">int</span> y, ' +
  13. '<span class="hljs-keyword">int</span> z)</span></span>;'
  14. );
  15. });
  16. });