Skip to content

Instantly share code, notes, and snippets.

View wzieba's full-sized avatar
🏎️

Wojciech Zięba wzieba

🏎️
View GitHub Profile
from unittest import TestCase
from main import replace_content, BlogEntry, fetch_and_parse_rss_feed
EXPECTED_CONTENT = "This is expected content in target block"
EXPECTED_RESULT = """#Header
<!-- blog starts -->
""" + EXPECTED_CONTENT + """
import re
from dataclasses import dataclass
import feedparser
MAX_FETCHED_BLOG_POSTS = 5
README_FILE_NAME = 'README.md'
@dataclass
name: Build README
on:
push:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
build:
{
"title": "mw",
"platform": "xbl",
"username": "tuksiarz",
"type": "wz",
"level": 140.0,
"maxLevel": 0.0,
"levelXpRemainder": 3000.0,
"levelXpGained": 7000.0,
"prestige": 0.0,
default_platform(:android)
platform :android do
desc "Deploy to Firebase App Distribution"
lane :firebase_distribution do
sh("wget https://github.com/appium/appium/raw/master/sample-code/apps/ApiDemos-debug.apk")
firebase_app_distribution(
name: Distribute to firebase
on:
workflow_dispatch:
jobs:
distribute:
runs-on: ubuntu-latest
steps:
fun main() {
val stringAssignedInCode = "foo\nbar"
val plainStringFromFile: String = this::class.java.classLoader.getResource("saved_line")!!.readText()
val stringSimplyReplaced = plainStringFromFile.replace("\\n", "\n")
val stringUnescapedWithApacheCommons = StringEscapeUtils.unescapeJava(plainStringFromFile)
fun main() {
val stringAssignedInCode = "foo\nbar"
val stringStoredInFile: String = this::class.java.classLoader.getResource("saved_line")!!.readText()
.replace("\\n", "\n")
assertThat(stringAssignedInCode).isEqualTo(stringStoredInFile)
}
fun main() {
val stringAssignedInCode = "foo\nbar"
val stringStoredInFile: String = this::class.java.classLoader.getResource("saved_line")!!.readText()
assertThat(stringAssignedInCode).isEqualTo(stringStoredInFile)
}
@wzieba
wzieba / saved_line
Created July 20, 2020 13:34
1. string escape sequences
foo\nbar