~ubuntu-branches/ubuntu/trusty/gmetrics/trusty

« back to all changes in this revision

Viewing changes to src/test/groovy/org/gmetrics/source/SourceStringTest.groovy

  • Committer: Package Import Robot
  • Author(s): Miguel Landaeta, Miguel Landaeta, tony mancill
  • Date: 2012-01-18 20:57:50 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120118205750-68fv86p7fs8xz470
Tags: 0.5-1
[Miguel Landaeta]
* New upstream release.
* Remove patch ftbfs_613266.diff since it was merged upstream.
* Update dates in copyright file.

[tony mancill]
* Set DMUA flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 * Tests for SourceString
22
22
 *
23
23
 * @author Chris Mair
24
 
 * @version $Revision: 29 $ - $Date: 2009-12-13 15:50:29 -0500 (Sun, 13 Dec 2009) $
 
24
 * @version $Revision: 155 $ - $Date: 2011-09-27 20:33:08 -0400 (Tue, 27 Sep 2011) $
25
25
 */
26
26
class SourceStringTest extends AbstractTestCase {
27
27
 
133
133
        assert sourceString.ast == null
134
134
    }
135
135
 
 
136
    void testIsValid() {
 
137
        assertTrue new SourceString(SOURCE).valid
 
138
        assertFalse new SourceString('XC$%ED@#').valid
 
139
    }
 
140
 
136
141
    void testGetLineNumberForCharacterIndex() {
137
142
        final NEW_SOURCE = '\nclass MyClass { \r\n  try {\n} catch(MyException e) {\n// TODO \n }\n }\n'
138
143
//        NEW_SOURCE.eachWithIndex { ch, i -> print "$i=${ch as int} " }