From dac0da03c2ccbef4a24621ce5242a6f081730d7d Mon Sep 17 00:00:00 2001 From: Amer Harb Date: Wed, 27 Sep 2023 08:33:25 +0200 Subject: [PATCH] test 6 --- .../kotlin/com/amerharb/atdate/MainTest.kt | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/at-date-console/src/test/kotlin/com/amerharb/atdate/MainTest.kt b/at-date-console/src/test/kotlin/com/amerharb/atdate/MainTest.kt index 03b39cd..2471b93 100644 --- a/at-date-console/src/test/kotlin/com/amerharb/atdate/MainTest.kt +++ b/at-date-console/src/test/kotlin/com/amerharb/atdate/MainTest.kt @@ -1,8 +1,5 @@ package com.amerharb.atdate -import java.awt.Toolkit -import java.awt.datatransfer.DataFlavor -import java.awt.datatransfer.StringSelection import java.io.ByteArrayOutputStream import java.io.InputStream import java.io.PrintStream @@ -291,7 +288,7 @@ class MainTest { @Test fun testCopyResult() { - clearClipboard() +// clearClipboard() val systemInMock = InputStreamMock("0xa0\nc\nq") System.setIn(systemInMock) main(emptyArray()) @@ -314,17 +311,17 @@ class InputStreamMock(input: String) : InputStream() { } } -fun getClipboard(): String { - val clipboard = Toolkit.getDefaultToolkit().systemClipboard - return clipboard.getData(DataFlavor.stringFlavor) as String -} - -fun clearClipboard() { - try { - val clipboard = Toolkit.getDefaultToolkit().systemClipboard - clipboard.setContents(StringSelection(""), null) - } catch (e: Exception) { - println("Error: ${e.message}") - System.err.println(e.message) - } -} +// fun getClipboard(): String { +// val clipboard = Toolkit.getDefaultToolkit().systemClipboard +// return clipboard.getData(DataFlavor.stringFlavor) as String +// } +// +// fun clearClipboard() { +// try { +// val clipboard = Toolkit.getDefaultToolkit().systemClipboard +// clipboard.setContents(StringSelection(""), null) +// } catch (e: Exception) { +// println("Error: ${e.message}") +// System.err.println(e.message) +// } +// }