allow negative assertion in injection tests (#4107)

* tests(vue, svelte): strengthen tests

* fix(html, vue, svelte): fix wrong test format

* allow negative assertions in injection tests
This commit is contained in:
lucario387 2023-01-07 19:22:20 +09:00 committed by GitHub
parent 0922634d37
commit 85d9534491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 84 additions and 135 deletions

View file

@ -5,38 +5,20 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet">
<style>
footer{
/* ^ css
*/
}
</style>
<style title="Test Style without type attribute">
footer{
/* ^ css
*/
}
</style>
<style type="text/css" title="test style with defined type attribute">
footer{
/* ^ css
*/
}
</style>
<style> footer{ } </style>
<!-- ^ css -->
<style title="Test Style without type attribute"> footer{ } </style>
<!-- ^ css -->
<style type="text/css" title="test style with defined type attribute"> footer{ } </style>
<!-- ^ css -->
</head>
<body>
<script>
const x = 1
// ^ javascript
</script>
<script defer>
const x = 1
// ^ javascript
</script>
<script type="text/javascript">
const x = 1
// ^ javascript
</script>
<script> const x = 1 </script>
<!-- ^ javascript -->
<script defer> const x = 1 </script>
<!-- ^ javascript -->
<script type="text/javascript"> const x = 1 </script>
<!-- ^ javascript -->
<div style="height: 100%">
<!-- ^ css -->
Test div to test css injections for style attributes