text:
beforeEach(function() {
    global.resetFeatures();
    global.addToEqualMatchMatcher();
});

describe('Unicode Base addon:', function() {

    /*
     * Many of the Unicode Base tests rely on \p{L} and its alias \p{Letter} which have character
     * data provided by the Unicode Categories addon. This allows more easily checking core
     * functionality from Unicode Base including handling of negation, astral vs default mode, and
     * syntax edge cases. However, it also provides coverage for the \p{L} class, which is
     * technically the responsibility if the Unicode Categories addon.
     */

    describe('adds new regex syntax:', function() {

        describe('\\p{...}, \\P{...}, \\p{^...}, and single-letter-name forms', function() {

            it('should be directly quantifiable', function() {
                expect(XRegExp('^\\p{L}+$').test('Café')).toBe(true);
                expect(XRegExp('^\\pL+$').test('Café')).toBe(true);
            });

            it('should throw an exception for double negation \\P{^...}', function() {
                expect(function() {XRegExp('\\P{^L}');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('[\\P{^L}]');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('[^\\P{^L}]');}).toThrowError(SyntaxError);
            });

            it('should throw an exception for \\p^ with a single-letter name', function() {
                expect(function() {XRegExp('\\p^L');}).toThrowError(SyntaxError);
            });

            it('should use the first letter only as the name if not wrapped with {...}', function() {
                expect(XRegExp('^\\pLetter+$').test('Café')).toBe(false);
                expect(XRegExp('^\\pLetter+$').test('Aetterrrrr')).toBe(true);
            });

            it('should work within character classes', function() {
                expect(XRegExp('^[\\p{L}]+$').test('Café')).toBe(true);
                expect(XRegExp('^[\\pL]+$').test('Café')).toBe(true);
            });

            it('should work in negated form within character classes', function() {
                expect(XRegExp('^[\\P{L}]+$').test('Café')).toBe(false);
                expect(XRegExp('^[\\PL]+$').test('Café')).toBe(false);
                expect(XRegExp('^[\\p{^L}]+$').test('Café')).toBe(false);
            });

            it('should work within negated character classes', function() {
                expect(XRegExp('^[^\\p{L}]+$').test('Café')).toBe(false);
                expect(XRegExp('^[^\\pL]+$').test('Café')).toBe(false);
            });

            it('should work in negated form within negated character classes', function() {
                expect(XRegExp('^[^\\P{L}]+$').test('Café')).toBe(true);
                expect(XRegExp('^[^\\PL]+$').test('Café')).toBe(true);
                expect(XRegExp('^[^\\p{^L}]+$').test('Café')).toBe(true);
            });

            it('should throw an exception within character classes, in astral mode', function() {
                XRegExp.install('astral');

                expect(function() {XRegExp('[\\p{L}]');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('[\\P{L}]');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('[\\pL]');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('[\\PL]');}).toThrowError(SyntaxError);
            });

            it('should throw an exception for unrecognized names', function() {
                var unrecognizedNames = ['X', 'Unrecognized_Name'];

                unrecognizedNames.forEach(function(name) {
                    expect(function() {XRegExp('\\p{' + name + '}');}).toThrowError(SyntaxError);
                    expect(function() {XRegExp('\\P{' + name + '}');}).toThrowError(SyntaxError);
                    expect(function() {XRegExp('\\p{^' + name + '}');}).toThrowError(SyntaxError);

                    if (name.length === 1) {
                        expect(function() {XRegExp('\\p' + name);}).toThrowError(SyntaxError);
                        expect(function() {XRegExp('\\P' + name);}).toThrowError(SyntaxError);
                    }
                });
            });

            it('should throw an exception if a name is not specified', function() {
                expect(function() {XRegExp('\\p{}');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('\\P{}');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('\\p{^}');}).toThrowError(SyntaxError);

                // Erroring on bare \p and \P is actually handled by xregexp.js, not Unicode Base
                expect(function() {XRegExp('\\p');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('\\P');}).toThrowError(SyntaxError);
            });

            it('should ignore spaces, underscores, hyphens, and casing in names', function() {
                expect(XRegExp('^\\p{ _-l --}+$').test('Café')).toBe(true);
            });

            it('should not ignore characters other than spaces, underscores, and hyphens in names', function() {
                expect(function() {XRegExp('\\p{L+}');}).toThrowError(SyntaxError);
                expect(function() {XRegExp('\\p{.L}');}).toThrowError(SyntaxError);
            });

            it('should require a negating caret to be the first character', function() {
                expect(function() {XRegExp('\\p{ ^L}');}).toThrowError(SyntaxError);
            });

        });

        (function() {
            var letters = (
                'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' +
                'ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüÿߺªØøÅåÆæÞþÐðŠšŽžИи' +
                '日本語' +
                'العربية'
            ).split('');
            var astralLetters = [
                String.fromCodePoint(0x1D7CB)
            ];
            var nonletters = (
                '0123456789' +
                '`~!@#$%^&*()-_=+[]{}<>\\/|;:\'",.?' +
                '©®™•§†‡¶½÷‰±°¢£€¥¤¡¿'
            ).split('');

            describe('\\p{L}, \\p{Letter}, and \\pL', function() {

                it('should match any BMP Unicode letter, in default (BMP) mode', function() {
                    letters.forEach(function(letter) {
                        expect(XRegExp('\\p{L}').test(letter)).toBe(true);
                        expect(XRegExp('\\p{Letter}').test(letter)).toBe(true);
                        expect(XRegExp('\\pL').test(letter)).toBe(true);
                    });
                });

                it('should not match any complete astral letter, in default (BMP) mode', function() {
                    astralLetters.forEach(function(astralLetter) {
                        expect(XRegExp('^\\p{L}$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\p{Letter}$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\pL$').test(astralLetter)).toBe(false);
                    });
                });

                it('should not match any Unicode nonletter, in default (BMP) mode', function() {
                    nonletters.forEach(function(nonletter) {
                        expect(XRegExp('\\p{L}').test(nonletter)).toBe(false);
                        expect(XRegExp('\\p{Letter}').test(nonletter)).toBe(false);
                        expect(XRegExp('\\pL').test(nonletter)).toBe(false);
                    });
                });

                it('should match any BMP Unicode letter, in astral mode', function() {
                    XRegExp.install('astral');

                    letters.forEach(function(letter) {
                        expect(XRegExp('\\p{L}').test(letter)).toBe(true);
                        expect(XRegExp('\\p{Letter}').test(letter)).toBe(true);
                        expect(XRegExp('\\pL').test(letter)).toBe(true);
                    });
                });

                it('should match any complete astral Unicode letter, in astral mode', function() {
                    XRegExp.install('astral');

                    astralLetters.forEach(function(astralLetter) {
                        expect(XRegExp('^\\p{L}$').test(astralLetter)).toBe(true);
                        expect(XRegExp('^\\p{Letter}$').test(astralLetter)).toBe(true);
                        expect(XRegExp('^\\pL$').test(astralLetter)).toBe(true);
                    });
                });

                it('should not match any Unicode nonletter, in astral mode', function() {
                    XRegExp.install('astral');

                    nonletters.forEach(function(nonletter) {
                        expect(XRegExp('\\p{L}').test(nonletter)).toBe(false);
                        expect(XRegExp('\\p{Letter}').test(nonletter)).toBe(false);
                        expect(XRegExp('\\pL').test(nonletter)).toBe(false);
                    });
                });

            });

            describe('\\P{L}, \\P{Letter}, \\PL, \\p{^L}, and \\p{^Letter}', function() {

                it('should not match any BMP Unicode letter, in default (BMP) mode', function() {
                    letters.forEach(function(letter) {
                        expect(XRegExp('\\P{L}').test(letter)).toBe(false);
                        expect(XRegExp('\\P{Letter}').test(letter)).toBe(false);
                        expect(XRegExp('\\PL').test(letter)).toBe(false);
                        expect(XRegExp('\\p{^L}').test(letter)).toBe(false);
                        expect(XRegExp('\\p{^Letter}').test(letter)).toBe(false);
                    });
                });

                it('should not match any complete astral letter, in default (BMP) mode', function() {
                    astralLetters.forEach(function(astralLetter) {
                        expect(XRegExp('^\\P{L}$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\P{Letter}$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\PL$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\p{^L}$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\p{^Letter}$').test(astralLetter)).toBe(false);
                    });
                });

                it('should match any Unicode nonletter, in default (BMP) mode', function() {
                    nonletters.forEach(function(nonletter) {
                        expect(XRegExp('\\P{L}').test(nonletter)).toBe(true);
                        expect(XRegExp('\\P{Letter}').test(nonletter)).toBe(true);
                        expect(XRegExp('\\PL').test(nonletter)).toBe(true);
                        expect(XRegExp('\\p{^L}').test(nonletter)).toBe(true);
                        expect(XRegExp('\\p{^Letter}').test(nonletter)).toBe(true);
                    });
                });

                it('should not match any BMP Unicode letter, in astral mode', function() {
                    XRegExp.install('astral');

                    letters.forEach(function(letter) {
                        expect(XRegExp('\\P{L}').test(letter)).toBe(false);
                        expect(XRegExp('\\P{Letter}').test(letter)).toBe(false);
                        expect(XRegExp('\\PL').test(letter)).toBe(false);
                        expect(XRegExp('\\p{^L}').test(letter)).toBe(false);
                        expect(XRegExp('\\p{^Letter}').test(letter)).toBe(false);
                    });
                });

                it('should not match any complete astral Unicode letter, in astral mode', function() {
                    XRegExp.install('astral');

                    astralLetters.forEach(function(astralLetter) {
                        expect(XRegExp('^\\P{L}$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\P{Letter}$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\PL$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\p{^L}$').test(astralLetter)).toBe(false);
                        expect(XRegExp('^\\p{^Letter}$').test(astralLetter)).toBe(false);
                    });
                });

                it('should match any Unicode nonletter, in astral mode', function() {
                    XRegExp.install('astral');

                    nonletters.forEach(function(nonletter) {
                        expect(XRegExp('\\P{L}').test(nonletter)).toBe(true);
                        expect(XRegExp('\\P{Letter}').test(nonletter)).toBe(true);
                        expect(XRegExp('\\PL').test(nonletter)).toBe(true);
                        expect(XRegExp('\\p{^L}').test(nonletter)).toBe(true);
                        expect(XRegExp('\\p{^Letter}').test(nonletter)).toBe(true);
                    });
                });

            });
        }());

    });

    describe('adds new regex flag A:', function() {

        (function() {
            var U_1D7CB = String.fromCodePoint(0x1D7CB);

            it('should match any astral letter with \\p{L} when using inline flag (?A)', function() {
                expect(XRegExp('(?A)^\\p{L}$').test(U_1D7CB)).toBe(true);
            });

            it('should match any astral letter with \\p{L} when using flag A', function() {
                expect(XRegExp('^\\p{L}$', 'A').test(U_1D7CB)).toBe(true);
            });

            it('should not match any astral letter with \\P{L} when using inline flag (?A)', function() {
                expect(XRegExp('(?A)^\\P{L}$').test(U_1D7CB)).toBe(false);
            });

            it('should not match any astral letter with \\P{L} when using flag A', function() {
                expect(XRegExp('^\\P{L}$', 'A').test(U_1D7CB)).toBe(false);
            });
        }());

        it('should throw an exception when using a Unicode token in a character class with inline flag (?A)', function() {
            expect(function() {XRegExp('(?A)[\\p{L}]');}).toThrowError(SyntaxError);
        });

        it('should throw an exception when using a Unicode token in a character class with flag A', function() {
            expect(function() {XRegExp('[\\p{L}]', 'A');}).toThrowError(SyntaxError);
        });

        it('should be equivalent to implicit astral mode', function() {
            XRegExp.install('astral');
            var implicit = XRegExp('\\p{L}');

            XRegExp.uninstall('astral');
            var explicit = XRegExp('\\p{L}', 'A');

            expect(explicit).toEqual(implicit);
        });

        it('should be exposed in extended flags prop when using implicit astral mode', function() {
            XRegExp.install('astral');
            expect(XRegExp('')[REGEX_DATA].flags).toBe('A');

            XRegExp.uninstall('astral');
            expect(XRegExp('')[REGEX_DATA].flags).toBe('');
        });

        it('should be exposed in flags arg of token functions when using implicit astral mode', function() {
            XRegExp.addToken(/~~FLAG-A-TEST/, function(match, scope, flags) {return flags;});

            XRegExp.install('astral');
            expect(XRegExp('~~FLAG-A-TEST!').source).toBe('A!');

            XRegExp.uninstall('astral');
            expect(XRegExp('~~FLAG-A-TEST!').source).toBe('!');
        });

    });

    describe('XRegExp.addUnicodeData()', function() {

        it('should throw an exception when name is not provided', function() {
            expect(function() {
                XRegExp.addUnicodeData([{bmp: '0'}]);
            }).toThrow();
        });

        it('should throw an exception when no BMP or astral data is provided', function() {
            expect(function() {
                XRegExp.addUnicodeData([{name: 'NoData'}]);
            }).toThrow();
        });

        (function() {
            it('should successfully add token XDigit with alias Hexadecimal', function() {
                XRegExp.addUnicodeData([{
                    name: 'XDigit',
                    alias: 'Hexadecimal',
                    bmp: '0-9A-Fa-f'
                }]);

                expect(XRegExp('\\p{XDigit}\\p{Hexadecimal}').test('0F')).toBe(true);
            });

            it('should successfully add token NotXDigit as the inverse of XDigit', function() {
                XRegExp.addUnicodeData([{
                    name: 'NotXDigit',
                    inverseOf: 'XDigit'
                }]);

                expect(XRegExp('\\p{NotXDigit}\\P{NotXDigit}').test('Z0')).toBe(true);
            });
        }());

        it('should throw an exception on use if the inverseOf target is missing', function() {
            XRegExp.addUnicodeData([{
                name: 'MissingRef',
                inverseOf: 'MissingToken'
            }]);

            expect(function() {XRegExp('\\p{MissingRef}');}).toThrowError(ReferenceError);
        });

        (function() {
            XRegExp.addUnicodeData([{name: 'AstralOnly', astral: '0'}]);

            it('should allow astral-only tokens to match, when in astral mode', function() {
                expect(XRegExp('\\p{AstralOnly}', 'A').test('0')).toBe(true);
            });

            it('should cause an exception to be thrown when using an astral-only token, when not in astral mode', function() {
                expect(function() {XRegExp('\\p{AstralOnly}');}).toThrowError(SyntaxError);
            });
        }());

        (function() {
            XRegExp.addUnicodeData([{name: 'BmpOnly', bmp: '0'}]);

            it('should allow BMP-only tokens to match, when not in astral mode', function() {
                expect(XRegExp('\\p{BmpOnly}').test('0')).toBe(true);
            });

            it('should allow BMP-only tokens to match, when in astral mode', function() {
                expect(XRegExp('\\p{BmpOnly}', 'A').test('0')).toBe(true);
            });
        }());

        (function() {
            XRegExp.addUnicodeData([{name: 'BmpPlusAstral', bmp: '0', astral: '1'}]);

            it('should allow BMP+astral tokens to match BMP values, when not in astral mode', function() {
                expect(XRegExp('\\p{BmpPlusAstral}').test('0')).toBe(true);
            });

            it('should not allow BMP+astral tokens to match astral values, when not in astral mode', function() {
                expect(XRegExp('\\p{BmpPlusAstral}').test('1')).toBe(false);
            });

            it('should allow BMP+astral tokens to match BMP values, when in astral mode', function() {
                expect(XRegExp('\\p{BmpPlusAstral}', 'A').test('0')).toBe(true);
            });

            it('should allow BMP+astral tokens to match astral values, when in astral mode', function() {
                expect(XRegExp('\\p{BmpPlusAstral}', 'A').test('1')).toBe(true);
            });
        }());

    });

});

describe('Unicode Categories addon:', function() {

    it('should not allow the "In" prefix for category names', function() {
        expect(function() {XRegExp('\\p{InP}');}).toThrowError(SyntaxError);
    });

    it('should not allow the "Is" prefix for category names', function() {
        expect(function() {XRegExp('\\p{IsP}');}).toThrowError(SyntaxError);
    });

    it('should not allow the "Script=" prefix for category names', function() {
        expect(function() {XRegExp('\\p{Script=P}');}).toThrowError(SyntaxError);
    });

    it('should handle \\p{Cn}', function() {
        testUnicodeToken('Cn', {
            invalid: ['\u20BA']
        });
    });

    it('should handle \\p{Ll}', function() {
        testUnicodeToken('Ll', {
            valid: ['a', 'и', 'ᾀ', 'lj', String.fromCodePoint(0x1D7CB)],
            invalid: ['A', 'И', '!']
        });

        /*
         * Special case: Categories Ll and Lu are handled differently depending on whether negation
         * is performed before or after case folding. No attempt is made to adjust this, so these
         * tests simply track the current (inconsistent and weird) handling. It's hard to say what
         * is correct because behavior for these cases is highly inconsistent across regex flavors.
         * The key point is that, with flag i, [\P{Ll}] is different than \P{Ll} and [^\p{Ll}].
         * Browsers are also inconsistent about how flag i works with some uncommon code points
         * (e.g., Chrome 21 doesn't let ᾀ match ᾈ, and Firefox 14 doesn't let lj match the titlecase
         * Lj), so just test common code points.
         */
        expect(XRegExp.match('AaИи!', XRegExp('\\p{Ll}',    'gi'))).toEqualMatch(['A', 'a', 'И', 'и']);
        expect(XRegExp.match('AaИи!', XRegExp('[\\p{Ll}]',  'gi'))).toEqualMatch(['A', 'a', 'И', 'и']);
        expect(XRegExp.match('AaИи!', XRegExp('[^\\P{Ll}]', 'gi'))).toEqualMatch([]);
        expect(XRegExp.match('AaИи!', XRegExp('\\P{Ll}',    'gi'))).toEqualMatch(['!']);
        expect(XRegExp.match('AaИи!', XRegExp('[^\\p{Ll}]', 'gi'))).toEqualMatch(['!']);
        expect(XRegExp.match('AaИи!', XRegExp('[\\P{Ll}]',  'gi'))).toEqualMatch(['A', 'a', 'И', 'и', '!']);
    });

    it('should handle \\p{P}', function() {
        testUnicodeToken('P', {
            valid: ['-', '\u00BF', '\u301C'],
            invalid: ['0']
        });
    });

    it('should handle \\p{Pe}', function() {
        testUnicodeToken('Pe', {
            valid: [')', '\u300B'],
            invalid: ['0']
        });
    });

    it('should handle \\p{S}', function() {
        testUnicodeToken('S', {
            valid: ['$', '\u20B9', '\u20BA', String.fromCodePoint(0x1F4A9)],
            invalid: ['0']
        });
    });

    it('should handle \\p{Sc}', function() {
        testUnicodeToken('Sc', {
            valid: ['$', '\u20B9', '\u20BA'],
            invalid: ['0']
        });
    });

    // TODO: Add complete specs (tests for category L/Letter are included in the Unicode Base specs)

});

describe('Unicode Properties addon:', function() {

    it('should not allow the "In" prefix for property names', function() {
        expect(function() {XRegExp('\\p{InASCII}');}).toThrowError(SyntaxError);
    });

    it('should not allow the "Is" prefix for property names', function() {
        expect(function() {XRegExp('\\p{IsASCII}');}).toThrowError(SyntaxError);
    });

    it('should not allow the "Script=" prefix for property names', function() {
        expect(function() {XRegExp('\\p{Script=ASCII}');}).toThrowError(SyntaxError);
    });

    it('should handle \\p{Alphabetic}', function() {
        testUnicodeToken('Alphabetic', {
            valid: ['A', 'a', 'Å', 'å', '日', 'ي'],
            invalid: ['0', '$']
        });
    });

    it('should handle \\p{Any}', function() {
        testUnicodeToken('Any', {
            valid: [String.fromCodePoint(0x10000), '\uD800', '\uDC00', 'A']
        });
    });

    it('should handle \\p{ASCII}', function() {
        testUnicodeToken('ASCII', {
            valid: ['\0', '\x7F'],
            invalid: ['\x80']
        });
    });

    it('should handle \\p{Assigned}', function() {
        testUnicodeToken('Assigned', {
            valid: [String.fromCodePoint(0x10000), '\uD800', '\uDC00', 'A', '\u20BA']
        });
    });

    // TODO: Add complete specs

});

describe('Unicode Scripts addon:', function() {

    it('should not allow the "In" prefix for script names', function() {
        expect(function() {XRegExp('\\p{InLatin}');}).toThrowError(SyntaxError);
    });

    it('should not allow the "Is" prefix for script names', function() {
        expect(function() {XRegExp('\\p{IsLatin}');}).toThrowError(SyntaxError);
    });

    it('should allow the "Script=" prefix for script names', function() {
        expect(function() {XRegExp('\\p{Script=Latin}');}).not.toThrow();
        testUnicodeToken('Script=Latin', {
            valid: ['A', 'B', 'C'],
            invalid: ['カ', 'タ', 'ナ']
        });
    });

    it('should handle \\p{Latin}', function() {
        testUnicodeToken('Latin', {
            valid: ['A', 'B', 'C'],
            invalid: ['カ', 'タ', 'ナ']
        });
    });

    it('should handle \\p{Katakana}', function() {
        testUnicodeToken('Katakana', {
            valid: ['カ', 'タ', 'ナ'],
            invalid: ['A', 'B', 'C']
        });
    });

    it('should handle \\p{Arabic}', function() {
        testUnicodeToken('Arabic', {
            valid: ['\u065F']
        });
    });

    it('should handle \\p{Inherited}', function() {
        testUnicodeToken('Inherited', {
            invalid: ['\u065F']
        });
    });

    it('should handle \\p{Common}', function() {
        testUnicodeToken('Common', {
            valid: ['\u20BA']
        });
    });

    it('should handle astral-only \\p{Anatolian_Hieroglyphs}', function() {
        testUnicodeToken('Anatolian_Hieroglyphs', {
            isAstralOnly: true,
            valid: [String.fromCodePoint(0x14400)]
        });
    });

    // TODO: Add complete specs

});


text:
module.exports = (client, opts) => {
  return client.get('/ecus/rrc/userprogram/activeprogram').then((r) => {
    return { value : r.value };
  });
};

redpajama_set_name: RedPajamaGithub


text:
#ifndef IPUBLICATIONSENDER_H
#define IPUBLICATIONSENDER_H

#include <string>

#include "joynr/JoynrExport.h"

namespace joynr
{

class SubscriptionPublication;
class SubscriptionReply;
class MessagingQos;

/**
 * @class IPublicationSender
 * @brief
 */
class JOYNR_EXPORT IPublicationSender
{
public:
    virtual ~IPublicationSender() = default;

    virtual void sendSubscriptionPublication(const std::string& senderParticipantId,
                                             const std::string& receiverParticipantId,
                                             const MessagingQos& qos,
                                             SubscriptionPublication&& subscriptionPublication) = 0;

    virtual void sendSubscriptionReply(const std::string& senderParticipantId,
                                       const std::string& receiverParticipantId,
                                       const MessagingQos& qos,
                                       const SubscriptionReply& subscriptionReply) = 0;
};

} // namespace joynr
#endif // IPUBLICATIONSENDER_H


text:
package printer_test

import (
	"strings"
	"testing"

	tt "github.com/ampproject/amppackager/transformer/internal/testing"

	"github.com/ampproject/amppackager/transformer/printer"
	"golang.org/x/net/html"
)

func TestQuotes(t *testing.T) {
	testCases := []tt.TestCase{
		{
			Desc: "Drops unnecessary quotes",
			Input: `<div class="content" id="content">`,
			Expected: "

",
		},
		{
			Desc: "Doesn't strip quotes",
			Input: `<p class="normal text" style="font-size: 12pt;">Hello World!</p>`,
			Expected: `<p class="normal text" style="font-size: 12pt;">Hello World!</p>`,
		},
		{
			Desc: "Some quotes stripped",
			Input: `<IMG src="http://www.google.com/a.jpg" alt="This is a image.">`,
			Expected: `<img alt="This is a image." src=http://www.google.com/a.jpg>`,
		},
		{
			Desc: "space is double quoted",
			Input: `<lemur x=" ">`,
			Expected: `<lemur x=" ">`,
		},
		{
			Desc: "double quote is single quoted",
			Input: "<lemur x='\"'>",
			Expected: "<lemur x=">",
		},
		{
			Desc: "= is quoted",
			Input: `<lemur x='a=b'>`,
			Expected: `<lemur x="a=b">`,
		},
		{
			Desc: "< is escaped and no quotes",
			Input: `<lemur x='a<b'>`,
			Expected: `<lemur x=a<b>`,
		},
		{
			Desc: "> is escaped and no quotes",
			Input: `<lemur x='a>b'>`,
			Expected: `<lemur x=a>b>`,
		},
		{
			Desc: "utf8 symbol is unquoted",
			Input: `<lemur x="❄">`,
			Expected: `<lemur x=❄>`,
		},
		{
			Desc: "utf8 turkish is unquoted",
			Input: `<lemur x="Beşiktaş">`,
			Expected: `<lemur x=Beşiktaş>`,
		},
		{
			Desc: "utf8 russian is unquoted",
			Input: `<lemur x="Вконтакте">`,
			Expected: `<lemur x=Вконтакте>`,
		},
	}
	runAllTestCases(t, testCases)
}

func TestStripsDocTypeAttrs(t *testing.T) {
	testCases := []tt.TestCase{
		{
			Desc: "No-op",
			Input: "<!doctype html>",
			Expected: "<!doctype html>",
		},
		{
			Desc: "Strips all attrs",
			Input: `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">`,
			Expected: "<!doctype html>",
		},
		{
			Desc: "Strips bogus attrs",
			Input: `<!DOCTYPE HTML PUBLIC "bogus" "notreal">`,
			Expected: "<!doctype html>",
		},
		{
			Desc: "Bogus doctype",
			Input: `<!DOCTYPE document SYSTEM "subjects.dtd">`,
			Expected: "<!doctype document>",
		},
	}
	runAllTestCases(t, testCases)
}

func TestAddsRequiredTags(t *testing.T) {
	testCases := []tt.TestCase{
		{
			Desc: "Adds html, head, and body tags.",
			Input: tt.Concat("<!doctype html>", tt.ScriptAMPRuntime, tt.LinkFavicon, "hello world"),
			Expected: tt.Concat("<!doctype html>", tt.ScriptAMPRuntime,
				tt.LinkFavicon, "hello world"),
		},
	}
	runAllTestCases(t, testCases)
}

func TestStripsWhitespace(t *testing.T) {
	testCases := []tt.TestCase{
		{
			Desc: "Strip whitespace pre doctype",
			Input: "\n\n\t\t    <!doctype html>",
			Expected: "<!doctype html>",
		},
		{
			Desc: "Strips intra tag whitespace",
			Input: `<lemur   lemur = "lemur" ></lemur>`,
			Expected: "<lemur lemur=lemur></lemur>",
		},
		{
			Desc: "Should not affect pre tags",
			Input: "
   foo
",
			Expected: "
   foo
",
		},
	}
	runAllTestCases(t, testCases)
}

func TestStripComments(t *testing.T) {
	testCases := []tt.TestCase{
		{
			Desc: "Strip comments",
			Input: tt.Concat("<!doctype html>",
				"<foo></foo>"),
			Expected: "<!doctype html><foo></foo>",
		},
		{
			Desc: "Strip comments embedded within text",
			Input: tt.Concat(
				"<!doctype html>",
				"are
 us!
",
				""),
			Expected: "<!doctype html>are
 us!
",
		},
	}
	runAllTestCases(t, testCases)
}

func TestClosesTags(t *testing.T) {
	testCases := []tt.TestCase{
		{
			Desc: "Closes tags.",
			Input: "<lemur>",
			Expected: "<lemur></lemur>",
		},
	}
	runAllTestCases(t, testCases)
}

func TestVoidTags(t *testing.T) {
	testCases := []tt.TestCase{
		{
			Desc: "Noop",
			Input: "
",
			Expected: "
",
		},
		{
			Desc: "Strip ending slash",
			Input: "
",
			Expected: "
",
		},
		{
			Desc: "End tag without start tag",
			Input: "
",
			Expected: "
",
		},
		{
			Desc: "Strip end tag with crazy spacing",
			Input: "",
			Expected: "",
		},
		{
			Desc: "Keep ending slash for void element in foreign content (SVG)",
			Input: "<svg><link rel=alternate /></svg>",
			Expected: "<svg><link rel=alternate /></svg>",
		},
		{
			Desc: "Keep ending slash for void element in foreign content (MathML)",
			Input: "<math><link rel=alternate /></math>",
			Expected: "<math><link rel=alternate /></math>",
		},
		{
			Desc: "Strip ending slash for void element in HTML integration point (SVG)",
			Input: "<svg><foreignobject><link rel=alternate /></foreignobject></svg>",
			Expected: "<svg><foreignobject><link rel=alternate></foreignobject></svg>",
		},
		{
			Desc: "Strip ending slash for void element in HTML integration point (MathML)",
			Input: "<math><annotation-xml encoding=text/html><link rel=alternate /></annotation-xml></math>",
			Expected: "<math><annotation-xml encoding=text/html><link rel=alternate></annotation-xml></math>",
		},
	}
	runAllTestCases(t, testCases)
}

func TestSelfClosedTags(t *testing.T) {
	testCases := []tt.TestCase{
		{
			// Self-closed tags are invalid HTML5. They should either be void tags or
			// proper start followed by end tag.
			Desc: "Self-closed tags",
			Input: "<lemur />foo",
			Expected: "<lemur>foo</lemur>",
		},
		{
			Desc: "Add end tag (when closing body tag is encountered)",
			Input: "<lemur/>foo",
			Expected: "<lemur>foo</lemur>",
		},
		{
			Desc: "Drop redundant end tag.",
			Input: "<lemur/>foo</lemur>bar",
			Expected: "<lemur>foo</lemur>bar",
		},
		{
			//


text:
package mc.sel.function.impl;

import mc.sel.function.Function;
import mc.sel.identifier.context.Context;

import java.util.List;

/**
 * Power function (Math.pow).
 *
 * @author Milan Crnjak
 */
public class PowFunction implements Function {

    @Override
    public Object execute(Context context, List<Object> args) {
        if (args == null || args.size() != 2) {
            throw new IllegalArgumentException("Pow function requires two arguments");
        }

        Number a = (Number) args.get(0);
        Number b = (Number) args.get(1);

        return Math.pow(a.doubleValue(), b.doubleValue());
    }
}


text:
@implementation ESHighlight

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeInteger:self.fromIndex forKey:@"fromIndex"];
    [aCoder encodeInteger:self.endIndex forKey:@"endIndex"];
    [aCoder encodeObject:self.text forKey:@"text"];
    [aCoder encodeObject:self.color forKey:@"color"];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];

    self.fromIndex= [aDecoder decodeIntegerForKey:@"fromIndex"];
    self.endIndex = [aDecoder decodeIntegerForKey:@"endIndex"];
    self.text = [aDecoder decodeObjectForKey:@"text"];
    self.color = [aDecoder decodeObjectForKey:@"color"];

    return self;
}

@end


text:
package com.google.cloud.example.library.v1.samples;

// [START example_v1_generated_LibraryService_DeleteBook_sync]
import com.google.cloud.example.library.v1.LibraryServiceClient;
import com.google.example.library.v1.BookName;
import com.google.example.library.v1.DeleteBookRequest;
import com.google.protobuf.Empty;

public class SyncDeleteBook {

  public static void main(String[] args) throws Exception {
    syncDeleteBook();
  }

  public static void syncDeleteBook() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
      DeleteBookRequest request =
          DeleteBookRequest.newBuilder()
              .setName(BookName.of("[SHELF]", "[BOOK]").toString())
              .build();
      libraryServiceClient.deleteBook(request);
    }
  }
}
// [END example_v1_generated_LibraryService_DeleteBook_sync]


text:
<?php

namespace DNT\WorkshopBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use DNT\WorkshopBundle\Entity\Factura;
use DNT\WorkshopBundle\Form\FacturaType;

/**
 * Factura controller.
 *
 */
class FacturaController extends Controller
{
    /**
     * Lists all Factura entities.
     *
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entities = $em->getRepository('DNTWorkshopBundle:Factura')->findAll();

        return $this->render('DNTWorkshopBundle:Factura:index.html.twig', array(
            'entities' => $entities
        ));
    }

    /**
     * Finds and displays a Factura entity.
     *
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('DNTWorkshopBundle:Factura')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Factura entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return $this->render('DNTWorkshopBundle:Factura:show.html.twig', array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),

        ));
    }

    /**
     * Displays a form to create a new Factura entity.
     *
     */
    public function newAction()
    {
        $entity = new Factura();
        $form   = $this->createForm(new FacturaType(), $entity);

        return $this->render('DNTWorkshopBundle:Factura:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView()
        ));
    }

    /**
     * Creates a new Factura entity.
     *
     */
    public function createAction()
    {
        $entity  = new Factura();
        $request = $this->getRequest();
        $form    = $this->createForm(new FacturaType(), $entity);
        $form->bindRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('factura_show', array('id' => $entity->getId())));

        }

        return $this->render('DNTWorkshopBundle:Factura:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView()
        ));
    }

    /**
     * Displays a form to edit an existing Factura entity.
     *
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('DNTWorkshopBundle:Factura')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Factura entity.');
        }

        $editForm = $this->createForm(new FacturaType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        return $this->render('DNTWorkshopBundle:Factura:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Edits an existing Factura entity.
     *
     */
    public function updateAction($id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('DNTWorkshopBundle:Factura')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Factura entity.');
        }

        $editForm   = $this->createForm(new FacturaType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        $request = $this->getRequest();

        $editForm->bindRequest($request);

        if ($editForm->isValid()) {
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('factura_edit', array('id' => $id)));
        }

        return $this->render('DNTWorkshopBundle:Factura:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Deletes a Factura entity.
     *
     */
    public function deleteAction($id)
    {
        $form = $this->createDeleteForm($id);
        $request = $this->getRequest();

        $form->bindRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getEntityManager();
            $entity = $em->getRepository('DNTWorkshopBundle:Factura')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Factura entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('factura'));
    }

    private function createDeleteForm($id)
    {
        return $this->createFormBuilder(array('id' => $id))
            ->add('id', 'hidden')
            ->getForm()
        ;
    }
}


text:
require File.expand_path('../helper', __FILE__)

class TestModuleGroupDefinition < Dbt::TestCase

  def test_defaults
    definition = Dbt::DatabaseDefinition.new(:default,
                                             :module_groups => {:foo => {:modules => [:Bar]}}) do |d|
      d.repository.modules = ['Bar', 'Baz']
    end
    module_groups = definition.module_groups
    assert_equal module_groups.size, 1

    module_group = module_groups.values[0]
    assert_equal module_group.key, :foo
    assert_equal module_group.database, definition
    assert_equal module_group.modules, [:Bar]
    assert_equal module_group.import_enabled?, false

    # Should not raise an exception
    module_group.validate
  end

  def test_invalid
    definition = Dbt::DatabaseDefinition.new(:default,
                                             :module_groups => {:foo => {:modules => [:Bar]}}) do |db|
      db.repository.modules = []
    end

    assert_raises RuntimeError, "Module Bar in module group foo does not exist in database module list []" do
      definition.module_groups.values[0].validate
    end
  end

  def test_missing_modules
    definition = Dbt::DatabaseDefinition.new(:default, :module_groups => {:foo => {}})

    assert_raises RuntimeError, "Missing modules configuration for module_group foo" do
      definition.module_groups.values[0].modules
    end
  end
end


text:
User.find(:all).each do |user|
  user.plugins.create(:title => "Videos", :position => (user.plugins.maximum(:position) || -1) +1)
end

page = Page.create(
  :title => "Videos",
  :link_url => "/videos",
  :deletable => false,
  :position => ((Page.maximum(:position, :conditions => "parent_id IS NULL") || -1)+1),
  :menu_match => "^/videos(\/|\/.+?|)$"
)
RefinerySetting.find_or_set(:default_page_parts, ["Body", "Side Body"]).each do |default_page_part|
  page.parts.create(:title => default_page_part, :body => nil)
end


text:
<!DOCTYPE html>

  <link href='https://fonts.googleapis.com/css?family=Press+Start+2P' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" type="text/css" href="../css/main.css">
  <link rel="stylesheet" type="text/css" href="../css/blocks.css">

    ?

    !

    !

    !


text:
import { Breed } from 'dog-ceo';

Breed.list((error?: Error, list?: string[]) => {});

Breed.getRandomImageUrl((error?: Error, url?: string) => {});

// $ExpectError
(new Breed());

const breed: Breed = new Breed('shiba');
(breed.identifier: string);

const subbreed: Breed = new Breed('foo', 'bar');
(subbreed.identifier: string);

breed.getImageUrls((error?: Error, urls?: string[]) => {});
breed.getRandomImageUrl((error?: Error, url?: string) => {});


text:
package net.nemerosa.ontrack.git.exceptions;

import java.io.File;
import java.io.IOException;

public class GitRepositoryDirException extends GitRepositoryException {

    public GitRepositoryDirException(File dir, IOException ex) {
        super(ex, "Cannot prepare repository directory at %s", dir.getPath());
    }

}


text:
@extends('bootstrap.layouts.master')

@section('content-title')
    {{ Translate::recursive('admin.menu.title.index', array('model' => 'user')) }}
@endsection

@section('content')

            {!! HTML::linkRoute('admin.users.create', Translate::recursive('common.new'), array(), array('class' => 'btn btn-default')) !!}

    @include('authentication::admin.users.filter')

    @include('authentication::admin.users.table')

@endsection


text:
/* Cypress.env('key') calls can be used here
Export a config object for testing */
module.exports = {
    url: Cypress.env('TEST_URL') || 'http://localhost:4200'
};


text:
                <button class="nav-item connections"></button>

                <button class="nav-item matches"></button>


text:
package garbagetown.domain.repository.tourinfo;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by garbagetown on 10/15/15.
 */
@Data
public class TourinfoCriteria implements Serializable {

    private Date depDate;
    private Integer tourDays;
    private String depCode;
    private String arrCode;
    private Integer adultCount;
    private Integer childCount;
    private Integer basePrice;
}


text:
package com.easytoolsoft.easyreport.data.criterion.operands;

public class LessThanOrEqualOperand extends AbstractOperand {

	private String columnName;
	private Object columnValue;

	public LessThanOrEqualOperand(String columnName, Object columnValue) {
		this.columnName = columnName;
		this.columnValue = columnValue;
	}

	@Override
	protected String toExpression() {
		return String.format("%1$s <= %2$s ", this.columnName, this.columnValue);
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GA.Nucleus.Population {
	public enum FitnessSortType { ASC, DESC }
}


text:
package com.codebrig.beam.connection.traversal.punch.udp.server;

import com.codebrig.beam.Communicator;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Brandon Fergerson <brandon.fergerson@codebrig.com>
 */
public class NATDevice
{

    private final ConcurrentHashMap<String, Integer> connections;
    private final Communicator comm;

    public NATDevice (Communicator comm) {
        this.connections = new ConcurrentHashMap<String, Integer> ();
        this.comm = comm;
    }

    public void addConnection (String accessCode, int port) {
        connections.put (accessCode, port);
    }

    public boolean validAccessCode (String accessCode) {
        return connections.get (accessCode) != null;
    }

    public int getConnectionPort (String accessCode) {
        Integer connPort = connections.get (accessCode);

        if (connPort == null) {
            return -1;
        }
        return connPort;
    }

    public Communicator getCommunicator () {
        return comm;
    }

}


text:
<!DOCTYPE html>

  <base target="_top">
  <link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css" />
  <?!= include('styles'); ?>

Data Filter

Filter a variable column by a value put into the input below. Then press
      Filter to insert the filtered data into a new sheet. Use
      Refresh Data to refresh the available variables in the drop down menu.

Numerical and text inputs are supported. Text inputs are case sensitive. For numerical inputs, negative and decimal numbers
      with periods can be used. Do not use commas in numerical input.

    <button class="button action" onclick="getVariables()">Refresh Data</button>

      <fieldset>
        <legend>First Filter</legend>
        <select id="varName1" data-select="variable" style="width: 100%;" onchange="checkSelectionState()">
          <option value="" disabled selected>Select the first variable</option>
        </select>
        <select class="select-operator" id="firstFilterOperator">
          <option value="=">=</option>
          <option value="!=">≠</option>
          <option value="<">
            <</option>
              <option value=">">></option>
              <option value="<=">≤</option>
              <option value=">=">≥</option>
        </select>
        <input type="text" id="firstFilterValue" />

          <button type="button" id="resetFirstButton" class="button" onclick="resetFilter('first')">Reset Filter</button>

      </fieldset>

        The secondary filter is optional. Select a boolean operator to enable editing of the second filter.

        <select id="boolean" onchange="enableSecondFilter()">
          <option value="" disabled selected style="display: none;">select an option</option>
          <option value="and">AND</option>
          <option value="or">OR</option>
        </select>

      <fieldset>
        <legend>Second Filter</legend>
        <select id="varName2" data-select="variable" style="width: 100%;" onchange="checkSelectionState()" disabled>
          <option value="" disabled selected style="display: none;">Select the second variable</option>
        </select>
        <select class="select-operator" id="secondFilterOperator" disabled>
          <option value="=">=</option>
          <option value="!=">≠</option>
          <option value="<">
            <</option>
              <option value=">">></option>
              <option value="<=">≤</option>
              <option value=">=">≥</option>
        </select>
        <input type="text" id="secondFilterValue" disabled />

          <button type="button" id="resetSecondButton" class="button" onclick="resetFilter('second')" disabled>Reset Filter</button>

      </fieldset>

      <input id="compareAllColumnsInput" type="checkbox" onChange="getAllColumns()" disabled /> Copy all columns over to a new tab in order to compare to the whole data set.

      <button type="button" id="filterBtn" class="button action" onclick="getRange()" disabled>Filter</button>
      <button type="button" class="button" onclick="google.script.host.close()">Close</button>

  <?!= include('filter-script'); ?>


text:
/* SHA-1-Authentication
 * login.c
 *
 * Chris Opperwall July 28, 2013
 */

#include <signal.h>
#include "auth.h"

int main()
{
   UserRegister *user_reg
      = malloc(sizeof(UserRegister)); /* Pointer to array of User *'s */
   int user_FD;                       /* File Descriptor for user file */

   signal(SIGINT, sig_call_back);

   /* Creates file if none exists, opens file if does */
   user_FD = file_setup(user_reg);
   user_list_init(user_reg, user_FD);

   printf(WELCOME);
   handle_user(user_reg);

   write_to_file(user_reg);
}