Improved DSL Array error checking

Change-Id: I4b1235f7363309bd2aa3e2f1b3e00c94b43976bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430058
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/tests/SkSLDSLTest.cpp b/tests/SkSLDSLTest.cpp
index dbd55ca..216d27e 100644
--- a/tests/SkSLDSLTest.cpp
+++ b/tests/SkSLDSLTest.cpp
@@ -556,6 +556,16 @@
     DSLExpression e = x + 1;
     REPORTER_ASSERT(r, e.type().isFloat());
     e.release();
+
+    {
+        ExpectError error(r, "error: array size must be positive\n");
+        Array(kFloat_Type, -1);
+    }
+
+    {
+        ExpectError error(r, "error: multidimensional arrays are not permitted\n");
+        Array(Array(kFloat_Type, 2), 2);
+    }
 }
 
 DEF_GPUTEST_FOR_MOCK_CONTEXT(DSLMatrices, r, ctxInfo) {