<commit_before>/*
 * Appcelerator Titanium Mobile
 * Copyright (c) 2015-2016 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */

var should = require('./utilities/assertions'),
	utilities = require('./utilities/utilities');

describe('Titanium.UI.AttributedString', function () {
	it('Ti.UI.AttributedString', function () {
		should(Ti.UI.AttributedString).not.be.undefined;
	});

	it('apiName', function () {
		var attributedString = Ti.UI.createAttributedString({text : 'abc'});
		should(attributedString).have.readOnlyProperty('apiName').which.is.a.String;
		should(attributedString.apiName).be.eql('Ti.UI.AttributedString');
	});

	it('createAttributedString', function () {
		should(Ti.UI.createAttributedString).not.be.undefined;
		should(Ti.UI.createAttributedString).be.a.Function;

		var attributedString = Ti.UI.createAttributedString({text : 'abc'});
		should(attributedString).be.a.Object;
		should(attributedString.apiName).be.a.String;
		should(attributedString.apiName).be.eql('Ti.UI.AttributedString');
		should(attributedString.text).be.a.String;
	});
	
	it('attributes', function() {
		var str = 'Lorem ipsum dolor sit amet.';
		var attributedString = Ti.UI.createAttributedString({
			text : str,
			attributes: [{
				type: Ti.UI.ATTRIBUTE_PARAGRAPH_STYLE,
				value: {
					alignment: Ti.UI.ATTRIBUTE_TEXT_ALIGNMENT_JUSTIFIED,
					minimumLineHeight: 40,
					headIndent: 5,
					lineSpacing: 5,
				},
				range: [0, str.length]
			}]
		});

		should(attributedString.text).be.eql(str);
		should(attributedString.attributes.length).be.eql(1);

		attributedString.addAttribute({
			type : Ti.UI.ATTRIBUTE_FONT,
			value: {fontSize : 16},
			range: [0, str.length]
        });

        should(attributedString.attributes.length).be.eql(2);
	});
});<commit_msg>[TIMOB-24080] : Linting issue fixed.<commit_after>/*
 * Appcelerator Titanium Mobile
 * Copyright (c) 2015-2016 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */

var should = require('./utilities/assertions'),
	utilities = require('./utilities/utilities');

describe('Titanium.UI.AttributedString', function () {
	it('Ti.UI.AttributedString', function () {
		should(Ti.UI.AttributedString).not.be.undefined;
	});

	it('apiName', function () {
		var attributedString = Ti.UI.createAttributedString({text : 'abc'});
		should(attributedString).have.readOnlyProperty('apiName').which.is.a.String;
		should(attributedString.apiName).be.eql('Ti.UI.AttributedString');
	});

	it('createAttributedString', function () {
		should(Ti.UI.createAttributedString).not.be.undefined;
		should(Ti.UI.createAttributedString).be.a.Function;

		var attributedString = Ti.UI.createAttributedString({text : 'abc'});
		should(attributedString).be.a.Object;
		should(attributedString.apiName).be.a.String;
		should(attributedString.apiName).be.eql('Ti.UI.AttributedString');
		should(attributedString.text).be.a.String;
	});
	
	it('attributes', function() {
		var str = 'Lorem ipsum dolor sit amet.';
		var attributedString = Ti.UI.createAttributedString({
			text: str,
			attributes: [{
				type: Ti.UI.ATTRIBUTE_PARAGRAPH_STYLE,
				value: {
					alignment: Ti.UI.ATTRIBUTE_TEXT_ALIGNMENT_JUSTIFIED,
					minimumLineHeight: 40,
					headIndent: 5,
					lineSpacing: 5
				},
				range: [0, str.length]
			}]
		});

		should(attributedString.text).be.eql(str);
		should(attributedString.attributes.length).be.eql(1);

		attributedString.addAttribute({
			type: Ti.UI.ATTRIBUTE_FONT,
			value: {fontSize : 16},
			range: [0, str.length]
		});
		should(attributedString.attributes.length).be.eql(2);
	});
});
{'fraction_non_alphanumeric': 0.14888597640891219, 'fraction_numerical': 0.010747051114023591, 'mean_word_length': 4.498559077809798, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '524938', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1254, 'n_words': 209}