mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Added test for CR line endings (DOS) in kobaltw.
This commit is contained in:
parent
2e3ca3bb24
commit
d108589185
1 changed files with 9 additions and 7 deletions
|
@ -3,14 +3,9 @@ package com.beust.kobalt
|
||||||
import com.beust.kobalt.misc.KFiles
|
import com.beust.kobalt.misc.KFiles
|
||||||
import com.beust.kobalt.misc.kobaltLog
|
import com.beust.kobalt.misc.kobaltLog
|
||||||
import org.testng.annotations.Test
|
import org.testng.annotations.Test
|
||||||
import java.io.File
|
import java.io.*
|
||||||
import java.io.FileInputStream
|
|
||||||
import java.io.FileReader
|
|
||||||
import java.io.InputStream
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.jar.JarEntry
|
import java.util.jar.*
|
||||||
import java.util.jar.JarFile
|
|
||||||
import java.util.jar.JarInputStream
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make sure the distribution zip file contains all the right files and no bad files.
|
* Make sure the distribution zip file contains all the right files and no bad files.
|
||||||
|
@ -35,6 +30,13 @@ class VerifyKobaltZipTest : KobaltTest() {
|
||||||
var entry = stream.nextEntry
|
var entry = stream.nextEntry
|
||||||
while (entry != null) {
|
while (entry != null) {
|
||||||
if (entry.name.endsWith("kobaltw")) {
|
if (entry.name.endsWith("kobaltw")) {
|
||||||
|
val ins = zipFile.getInputStream(entry)
|
||||||
|
ins.readBytes().forEach {
|
||||||
|
// Look for carriage returns
|
||||||
|
if (it.compareTo(13) == 0) {
|
||||||
|
throw KobaltException("kobaltw has wrong line endings")
|
||||||
|
}
|
||||||
|
}
|
||||||
foundKobaltw = true
|
foundKobaltw = true
|
||||||
} else if (entry.name.endsWith(mainJarFilePath)) {
|
} else if (entry.name.endsWith(mainJarFilePath)) {
|
||||||
val ins = zipFile.getInputStream(entry)
|
val ins = zipFile.getInputStream(entry)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue