<commit_before>define(
    [
        'src/angular-transform',
        'text!test/some.atpl'
    ],
    function(transform, template) {
        'use strict';
        describe('angular-transform', function() {
            it("first try", function() {
                var data = {
                    company: "Some Company",
                    employees: [
                        { name: 'Jack', age: '31'},
                        { name: 'Jill', age: '29'}
                    ]
                };
                
                var result = transform(data, template);

                // Remove whitespace between tags
                result = result.replace(/\>[\n\t ]+</g, '><');
                
                expect(result).toBe('<?xml version="1.0" encoding="UTF-8"?><company><name>Some Company</name><employees><employee><name>Jack</name><age>31</age></employee><employee><name>Jill</name><age>29</age></employee></employees></company>');
            });
        });
    }
);<commit_msg>Added some XML testcases<commit_after>define(
    [
        'src/angular-transform',
        'text!test/some.atpl',
        'lodash'
    ],
    function(angularTransform, template, _) {
        'use strict';

        /**
         * Creates multiple specs at once, which execute the same test code but with
         * different params. The last argument should contain a function which contains
         * the test code. All params before this function are objects containing the
         * params which are passed to the testcases.
         *
         * Example:
         *
         *   it.cases(
         *       { param: 1, expected: 1, description: '1 should equal 1' },
         *       { param: 2, expected: 2, description: '2 should equal 2' },
         *       function (param, expected) {
         *           expect(param).toBe(expected);
         *       }
         *   );
         */
        it.cases = function() {
            var testFn = arguments[arguments.length - 1];
            var testcases = _.map(_.without(arguments, testFn));

            _.each(testcases, function(testcase) {
                var description = testcase.description || "!!! Add a description property to your testcase object !!!";
                it(description, function() {
                    var args = _.map(testcase);
                    testFn.apply(this, args);
                });
            }, this);
        };

        describe('angularTransform', function() {

            describe('to XML', function() {
                it.cases({
                        description: 'no data',
                        config: {
                            template: '<?xml version="1.0" encoding="UTF-8"?>'
                        },
                        expected: '<?xml version="1.0" encoding="UTF-8"?>'
                    }, {
                        description: 'render value in element',
                        config: {
                            data: {
                                key: 'value'
                            },
                            template: '<?xml version="1.0" encoding="UTF-8"?><key><at>{{key}}</at></key>'
                        },
                        expected: '<?xml version="1.0" encoding="UTF-8"?><key>value</key>'
                    }, {
                        description: 'render value in attribute',
                        config: {
                            data: {
                                key: 'value'
                            },
                            template: '<?xml version="1.0" encoding="UTF-8"?><key value="{{key}}"></key>'
                        },
                        expected: '<?xml version="1.0" encoding="UTF-8"?><key value="value"></key>'
                    },
                    function(config, expected) {
                        var result = angularTransform(config);
                        result = result.replace(/\>[\n\t ]+</g, '><');
                        expect(result).toBe(expected);
                    }
                );
            });

            it("first try", function() {
                var data = {
                    company: "Some Company",
                    employees: [{
                        name: 'Jack',
                        age: '31'
                    }, {
                        name: 'Jill',
                        age: '29'
                    }]
                };

                var result = angularTransform({
                    data: data,
                    template: template,
                    output: {
                        format: "xml",
                        indented: true,
                        removeAngularComments: true
                    }
                });

                // Remove whitespace between tags
                result = result.replace(/\>[\n\t ]+</g, '><');

                expect(result).toBe('<?xml version="1.0" encoding="UTF-8"?><company><name>Some Company</name><employees><employee><name>Jack</name><age>31</age></employee><employee><name>Jill</name><age>29</age></employee></employees></company>');
            });
        });
    }
);
{'fraction_non_alphanumeric': 0.13740011693626974, 'fraction_numerical': 0.009549795361527967, 'mean_word_length': 1.1268130957314546, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 8, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, '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': '6623310', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1179, 'n_words': 255}