Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add css_engine input test #39

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,45 @@ jobs:
git diff --exit-code --no-index \
tests/js_engine/uglify-js/main.expected.js \
tests/js_engine/uglify-js/main.min.js

css_engine_lightning:
name: "css_engine / lightning"
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Test css_engine lightning
uses: ./
with:
directory: "tests/css_engine"
output: "tests/css_engine/lightning"
css_engine: "lightning"

- name: Assert css_engine lightning result matches expected
run: |
git diff --exit-code --no-index \
tests/css_engine/lightning/main.expected.css \
tests/css_engine/lightning/main.min.css

css_engine_clean_css:
name: "css_engine / clean-css"
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Test css_engine clean-css
uses: ./
with:
directory: "tests/css_engine"
output: "tests/css_engine/clean-css"
css_engine: "clean-css"

- name: Assert css_engine clean-css result matches expected
run: |
git diff --exit-code --no-index \
tests/css_engine/clean-css/main.expected.css \
tests/css_engine/clean-css/main.min.css
1 change: 1 addition & 0 deletions tests/css_engine/clean-css/main.expected.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/css_engine/lightning/main.expected.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions tests/css_engine/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/* Example CSS file for minification testing */

/* Basic styling */
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}

h1, h2, h3 {
color: #333;
}

p {
color: #666;
line-height: 1.5;
}

/* Class selector */
.container {
width: 80%;
margin: auto;
overflow: hidden;
}

/* ID selector */
#main-header {
background-color: #333;
color: #fff;
padding: 20px;
}

/* Hover pseudo-class */
a:hover {
color: #0099cc;
}

/* Animation */
@keyframes slideIn {
from {
transform: translateX(-100%);
}
to {
transform: translateX(0);
}
}

.animated-slide-in {
animation: slideIn 1s ease-out;
}

/* Media query */
@media (max-width: 600px) {
.container {
width: 100%;
}
}

/* Nested selectors */
.nav ul {
list-style: none;
background-color: #333;
}

.nav ul li {
display: inline;
margin-right: 5px;
}

.nav ul li a {
text-decoration: none;
color: #fff;
padding: 5px 10px;
background-color: #333;
}

/* Attribute selector */
input[type="text"] {
border: 1px solid #ccc;
padding: 10px;
}

/* Pseudo-element */
.button::before {
content: '>>';
margin-right: 5px;
}

/* Issue #27 */
ul > li:not(.class ul > li, .another-class ul > li) {
display: none;
}

/* End of file */
Loading