<commit_before>import Ember from "ember";
import {test, moduleForComponent} from "ember-qunit";

var _rgb2hex = function (rgb) {
    var isRGBA = false;

    if (/^#[0-9A-F]{6}$/i.test(rgb)) return rgb;

    isRGBA = rgb.indexOf('rgba') > -1;

    rgb = isRGBA
                ? rgb.match(/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+)\)$/)
                : rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);

    function hex(x) {
        return ("0" + parseInt(x).toString(16)).slice(-2).toUpperCase();
    };

    if(isRGBA){
        return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]) + hex(rgb[4]);
    }
    else{
        return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
     }
};

moduleForComponent('ember-json-pretty');

test('verify if tag name is PRE', function(){
    var component = this.subject(),
        jsonObj;
    
    Ember.run(function(){
        jsonObj = {
            'key1': 'value1',
            'key2': 'value2'
        };
        component
            .set(
                'jsonObj',<commit_msg>Adjust error in JSHint to tests.<commit_after>import Ember from "ember";
import {test, moduleForComponent} from "ember-qunit";

var _rgb2hex = function (rgb) {
    var isRGBA = false;

    if (/^#[0-9A-F]{6}$/i.test(rgb)) return rgb;

    isRGBA = rgb.indexOf('rgba') > -1;

    rgb = isRGBA ? rgb.match(/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+)\)$/)
                : rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);

    function hex(x) {
        return ("0" + parseInt(x).toString(16)).slice(-2).toUpperCase();
    };

    if(isRGBA){
        return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]) + hex(rgb[4]);
    }
    else{
        return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
     }
};

moduleForComponent('ember-json-pretty');

test('verify if tag name is PRE', function(){
    var component = this.subject(),
        jsonObj;
    
    Ember.run(function(){
        jsonObj = {
            'key1': 'value1',
            'key2': 'value2'
        };
        component
            .set(
                'jsonObj',
{'fraction_non_alphanumeric': 0.22836185819070903, 'fraction_numerical': 0.019559902200488997, 'mean_word_length': 2.13323124042879, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2133309', 'n_tokens_mistral': 787, 'n_tokens_neox': 753, 'n_words': 132}